2015-06-09 246 views
3

我已經開始學習Angular JS。我正在通過這個,那就是建設簡單的phonecat appnpm install:install無法讀取依賴關係

我正在按照步驟操作。 已下載Node.js。 試圖執行此命令:npm install

時出錯: C:> NPM安裝

npm ERR! install Couldn't read dependencies 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" 
npm ERR! node v0.12.4 
npm ERR! npm v2.10.1 
npm ERR! path C:\package.json 
npm ERR! code ENOPACKAGEJSON 
npm ERR! errno -4058 

npm ERR! package.json ENOENT, open 'C:\package.json' 
npm ERR! package.json This is most likely not a problem with npm itself. 
npm ERR! package.json npm can't find a package.json file in your current directo 
ry. 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" 
npm ERR! node v0.12.4 
npm ERR! npm v2.10.1 

npm ERR! Uncaught, unspecified "error" event. 
npm ERR! 
npm ERR! If you need help, you may report this error at: 
npm ERR!  <https://github.com/npm/npm/issues> 

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

C:\> 
+2

您不必在文件的package.json你的目錄。 –

+0

[此SO問題]的副本(http://stackoverflow.com/questions/30722155/how-can-i-deal-with-this-npm-err)。 – mscdex

+0

是的,我有:路徑是:C:\ Program Files文件(x86)\ nodejs \ node_modules \ npm – VBMali

回答

8

之前執行命令npm install 執行此cd myproject,然後執行此:npm install

其解決。謝謝。

1

Like Bilhan A說:你需要改變你克隆項目到的文件夾。 從你的問題我假設你是編程新手,並且主要想學習Angularjs。 Node.js不需要這個。如果你真的想學習Angular,我推薦像this one這樣的教程,它不需要node.js.當你瞭解它是如何工作的時候,回到node.js併合並它們。

1

name字段在package.json應該與您的項目目錄的名稱相同。

0

如果是這樣顯示的那麼簡單地更新故宮的錯誤,我現在面臨這個問題,這就是爲什麼我在這裏更新,它可能會幫助一些一個

$ npm install 
npm ERR! install Couldn't read dependencies 
npm ERR! Windows_NT 10.0.14393 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" 
"C:\\Program F iles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" 
"install" 
npm ERR! node v4.4.5 
npm ERR! npm v2.15.5 
npm ERR! path C:\Users\joy\package.json 
npm ERR! code ENOPACKAGEJSON 
npm ERR! errno -4058 
npm ERR! syscall open 
npm ERR! package.json ENOENT: no such file or directory, open  
npm ERR! package.json This is most likely not a problem with npm itself. 
npm ERR! package.json npm can't find a package.json file in your current  
npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\joy\Desktop\TEMP\node\chatsys\npm-debug.log