【问题标题】:Error in installing pm2安装pm2时出错
【发布时间】:2019-09-26 17:36:32
【问题描述】:

我想在我的树莓派 3 上安装 pm2:

npm install -g pm2

但我收到此错误:

(node:5118) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use 
os.tmpdir() instead.
npm ERR! Error: Method Not Allowed
npm ERR!     at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR!     at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.9.59-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "pm2"
npm ERR! cwd /home/pi/JSMTProxy
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/JSMTProxy/npm-debug.log
npm ERR! not ok code 0

我尝试在命令前添加 sudo,但没有任何改变。

【问题讨论】:

  • 您使用的是相当旧的 npm 版本,请尝试更新它。

标签: linux npm raspberry-pi pm2


【解决方案1】:

您需要更新npm

使用以下命令再试一次:

npm install -g npm@latest

【讨论】:

  • sudo npm install -g pm2 > sudo: npm: command not found
  • 奇怪的是,删除了-g 工作(即sudo npm install pm2)。不知道这就是我想要的。
猜你喜欢
  • 2015-01-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-23
  • 1970-01-01
  • 1970-01-01
  • 2018-03-19
  • 1970-01-01
相关资源
最近更新 更多