簡體   English   中英

Node.js:npm不再安裝

[英]Node.js: npm doesn't install anymore

我不知道我做錯了什么,但是嘗試使用npm安裝模塊會返回錯誤。 我的具體示例(結果相同,無論我要安裝哪個模塊):

npm install socket.io

返回值:

npm ERR! TypeError: Cannot call method 'replace' of undefined
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:332:45
npm ERR!     at fs.js:117:20
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:53:5
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:62:5
npm ERR!     at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io"
npm ERR! cwd /Users/Hassen/www/node/btask
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! type non_object_property_call
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Hassen/www/node/btask/npm-debug.log
npm ERR! not ok code 0

任何想法? 提前致謝 :)

此錯誤通常是由當前目錄中的.git目錄引起的,該目錄中沒有提交任何提交。

在再次嘗試npm之前,請刪除目錄或至少提交一次。

編輯:從此npm問題頁

此問題已在最新版本中修復。 請更新到最新的節點和npm(分別為v0.8.17和v1.2.0)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM