express - "not listed in package.json" , node.js while installing NTVS -
in red box following status show modules.. can me.. advance
open command prompt , cd project directory (you can right-click project in solution explorer , choose open command prompt here...
).
type npm init
, fill in fields when prompted (or hit enter
take default). output should this...
c:\anthony\demo\expressapp1\expressapp1>npm init utility walk through creating package.json file. covers common items, , tries guess sane defaults. see `npm json` definitive documentation on these fields , do. use `npm install <pkg> --save` afterwards install package , save dependency in package.json file. press ^c @ time quit. name: (expressapp1) version: (0.0.0) description: entry point: (app.js) test command: git repository: keywords: author: license: (isc) write c:\anthony\demo\expressapp1\expressapp1\package.json: { "name": "expressapp1", "version": "0.0.0", "description": "", "main": "app.js", "dependencies": { "express": "~3.4.4", "jade": "~1.1.5", "stylus": "~0.42.2" }, "devdependencies": {}, "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "", "license": "isc" } ok? (yes)
if reason npm init
doesn't work, can save following text file called package.json
in root of project , update values match packages in project.
{ "name": "expressapp1", "version": "0.0.0", "description": "", "main": "app.js", "dependencies": { "express": "~3.4.4", "jade": "~1.1.5", "stylus": "~0.42.2" }, "devdependencies": {}, "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "", "license": "isc" }
a third option delete npm_modules
folder in project. can right click on npm
"folder" in solution explorer, select manage npm modules...
, , reinstall packages. installing them way should create package.json
you.
Comments
Post a Comment