1

我安装了 Node.js 并更新了我的 $PATH 环境。然而,在多次尝试为应用程序安装 zurb 基础后,我得到了同样的错误。我该如何修复它?任何见解将不胜感激。谢谢!

我运行这个命令...

npm install -g foundation-cli bower gulp

我收到以下错误

Error: ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/upload.js'
    at Error (native)
    at Object.fs.statSync (evalmachine.<anonymous>:849:18)
    at /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/index.js:54:19
    at Array.forEach (native)
    at CachingRegistryClient.RegClient (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/index.js:50:42)
    at new CachingRegistryClient (/usr/local/lib/node_modules/npm/lib/cache/caching-client.js:20:18)
    at /usr/local/lib/node_modules/npm/lib/npm.js:363:22
    at /usr/local/lib/node_modules/npm/lib/config/core.js:82:7
    at Array.forEach (native)
    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:13
npm ERR! Darwin 14.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "foundation-cli" "bower" "gulp"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4
npm ERR! path /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/upload.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall stat

npm ERR! enoent ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/upload.js'
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 
4

1 回答 1

0

我认为不upload.js应该是该目录中的文件。我有这个完全相同的错误。我去了那个目录并输入ls -a

lrwxr-xr-x   1 jay   admin   105 Dec  7  2013 upload.js -> ../../../../../../Cellar/node/0.10.22/lib/node_modules/npm/node_modules/npm-registry-client/lib/upload.js

这是一个旧的符号链接,指向早已安装的节点版本homebrew。我删除了符号链接重新安装的节点,没有安装 upload.js,所以我认为它甚至不是当前节点中存在的文件。但它现在对我有用!

于 2015-10-01T02:33:55.630 回答