2017-04-03 111 views
0
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
npm ERR! node v0.12.7 
npm ERR! npm v2.11.3 
npm ERR! path C:\angularjs2\package.json 
npm ERR! code ENOENT 
npm ERR! errno -4058 

npm ERR! enoent ENOENT, open 'C:\angularjs2\package.json' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\angularjs2\npm-debug.log 
+1

消息很清楚:'ENOENT,open'C:\ angularjs2 \ package.json'' ...'npm無法找到文件' – Jens

回答

1

運行npm start你需要在你想開始一個模塊的的package.json所在的目錄:

cd /path/to/module 
npm start 

如果沒有尚的package.json,那麼你可以創建一個具有:

npm init 

記住,你需要定義一個start腳本,像這樣:

"scripts": { 
    "start": "node module.js" 
} 

in package.json。