0

When installing pm2 with "npm install -g" command, I got this error. I do not know why the "-g" option is appended to present working directory and then it returns ENOENT (no such file or directory) Anyone faced this problem, please help to solve this. Many thanks in advance. Below is the log when installing:

[root@XXXXX folder]# npm install –g pm2@1.0.1
npm ERR! addLocal Could not install /path/to/project/folder/–g
npm ERR! fetch failed https://registry.npmjs.org/pm2/-/pm2-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! fetch failed https://registry.npmjs.org/pm2/-/pm2-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
npm ERR! fetch failed https://registry.npmjs.org/pm2/-/pm2-1.0.1.tgz
npm ERR! Linux 2.6.32-431.el6.x86_64
npm ERR! argv "/opt/dtv/node-v4.2.6-linux-x64/bin/node" "/opt/dtv/node-v4.2.6-linux-x64/bin/npm" "install" "–g" "pm2@1.0.1"
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! path /path/to/project/folder/–g
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/path/to/project/folder/–g'
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
thelonglqd
  • 1,805
  • 16
  • 28

1 Answers1

0

The order is reversed, Try: npm install pm2@1.0.1 -g

Rahat Mahbub
  • 2,967
  • 17
  • 29