2

我正在尝试通过 shell 命令行使用 npm 永久安装:

npm install forever

这是我得到的回应:

npm ERR! Failed to parse json
npm ERR! Unexpected end of input
npm ERR! File: /home/MYUSER/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! System Linux 3.1.9-vs2.3.2.5
npm ERR! command "/home/MYUSER/.nvm/v0.8.17/bin/node" "/home/MYUSER/.nvm/v0.8.17/bin/npm" "install" "forever"
npm ERR! cwd /home/MYUSER
npm ERR! node -v v0.8.17
npm ERR! npm -v 1.2.0
npm ERR! file /home/MYUSER/package.json
npm ERR! code EJSONPARSE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/MYUSER/npm-debug.log
npm ERR! not ok code 0

我通过 npm 安装其他任何东西都没有任何问题。为什么这个?


实际上,我需要在 npm 目录中!

4

1 回答 1

2

尝试从中删除下载的模块node_modules/forever并重新安装:[sudo] npm install forever -g,永远应该安装-g(全局)

于 2013-01-17T08:47:46.990 回答