使用 npm 在 nodeenv 上安装 grunt 导致 findup-sync 错误

Using npm to install grunt on nodeenv results in findup-sync error

使用nodeenv建立节点virtualenv后,我使用source /bin/activate 切换到正确的目录,更新 npm,然后执行

npm install -g gruntnpm install -g grunt-cli 并且我收到相同的错误:

npm ERR! Linux 3.13.0-53-generic
npm ERR! argv "node" "/home/{redacted-home-dir}/NodeProjects/vue/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v0.12.4
npm ERR! npm  v2.11.1
npm ERR! file /home/{redacted-home-dir}/.npm/findup-sync/0.1.3/package/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR! 
npm ERR! ^
npm ERR! File: /home/{redacted-home-dir}/.npm/findup-sync/0.1.3/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR! 
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR!     /home/{redacted-home-dir}/NodeProjects/vue/npm-debug.log

A similar error 在 findup-sync Github 上被记录下来,但这是 npm 的最新版本。

根据 npm 文档,Grunt 的 package.json 说 "approximately 0.1.2"。

我也尝试过单独安装findup-sync,但没有用。

关于我的电脑的其他详细信息:Linux (Debian/Ubuntu 14.04)。 64 位。

您的缓存可能已损坏:npm cache clean