我安装了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
我不认为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,所以我认为它甚至不是当前节点中存在的文件。但现在对我有用了!!