2017-02-15 101 views
0

同時啓動npm它給下面的錯誤,看來,這是不能夠找到JSON文件,請檢查下面的細節與日誌文件一起NPM啓動命令找不到NPM v3.10.8 JSON文件

simplymacs-MacBook-Air-2:hackoregon_component_library 
MelissaKeith$ npm "start" 
npm ERR! Darwin 15.6.0 
npm ERR! argv "/usr/local/Cellar/node/6.8.1/bin/node" "/usr/local/bin/npm" "start" 
npm ERR! node v6.8.1 
npm ERR! npm v3.10.8 
npm ERR! path /Users/MelissaKeith/package.json 
npm ERR! code ENOENT 
npm ERR! errno -2 
npm ERR! syscall open 

npm ERR! enoent ENOENT: no such file or directory, open '/Users/MelissaKeith/package.json' 
npm ERR! enoent ENOENT: no such file or directory, open '/Users/MelissaKeith/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!  /Users/MelissaKeith/hackoregon_component_library/npm-debug.log 

NPM-的debug.log

0 info it worked if it ends with ok 
1 verbose cli [ '/usr/local/Cellar/node/6.8.1/bin/node', 
1 verbose cli '/usr/local/bin/npm', 
1 verbose cli 'start' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose config Skipping project config: /Users/MelissaKeith/.npmrc. (matches userconfig) 
5 verbose stack Error: ENOENT: no such file or directory, open '/Users/MelissaKeith/package.json' 
5 verbose stack  at Error (native) 
6 verbose cwd /Users/MelissaKeith/hackoregon_component_library 
7 error Darwin 15.6.0 
8 error argv "/usr/local/Cellar/node/6.8.1/bin/node" "/usr/local/bin/npm" "start" 
9 error node v6.8.1 
10 error npm v3.10.8 
11 error path /Users/MelissaKeith/package.json 
12 error code ENOENT 
13 error errno -2 
14 error syscall open 
15 error enoent ENOENT: no such file or directory, open '/Users/MelissaKeith/package.json' 
16 error enoent ENOENT: no such file or directory, open '/Users/MelissaKeith/package.json' 
16 error enoent This is most likely not a problem with npm itself 
16 error enoent and is related to npm not being able to find a file. 
17 verbose exit [ -2, true ] 
+1

在你運行'npm start'的目錄中是否有'package.json'文件? – carebdayrvis

+0

你的'package.json'在哪裏? – jiyinyiyong

+0

有一個的package.json文件和目錄 – Melissa

回答

0

我有一個非常類似的問題。刪除整個node_modules文件夾並重新安裝爲我工作。當您安裝舊模塊(如您的package.json中所寫)時會發生此問題,但由於其版本中的更新,它在git上不可用:

爲了解決這個問題。

rm -rf node_modules 
npm install 
+0

的主要文件將如何檢查我的模塊是過時與github上的?在這種情況下,node_module是什麼意思? – Melissa

+0

simplymacs -MacBook-Air-2:hackoregon_component_library MelissaKeith $ rm -rf node_modules simplymacs -MacBook-Air-2:hackoregon_component_library MelissaKeith $ npm install npm WARN enoent ENOENT:沒有這樣的文件或目錄,打開'/ Users/MelissaKeith/package以.json」 NPM WARN MelissaKeith沒有說明 NPM WARN MelissaKeith無庫場。 NPM WARN MelissaKeith沒有README數據 NPM WARN MelissaKeith沒有許可證場。 – Melissa

+0

有一個模塊'npm-check',它檢查過期的,不正確的和未使用的依賴關係。 https://github.com/dylang/npm-check –