Error while updating to latest pm2 - node.js

I tried updating pm2 with "npm install pm2#latest -g" (Cent OS 6) but received the following error. Now, i am no longer able to use "pm2 list" (it says command not found). Your help will be highly appreciated.
npm ERR! Linux 2.6.32-042stab094.8
npm ERR! argv "node" "/home/username/local/bin/npm" "install" "pm2" "-g"
npm ERR! node v0.12.1
npm ERR! npm v2.7.3
npm ERR! Cannot read property 'trim' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

Updating to Latest npm (2.11.1) solved this issue.
Thanks.

Related

why is npm giving me weird errors?

Hi I am really new to learn redux.
I was keep trying install redux in VSC.
So I typed command "npm init" first. And then I typed "npm i redux".
As a result I got those error messages.
Here is the Error
npm ERR! Linux 5.8.0-63-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "redux"
npm ERR! node v14.17.0
npm ERR! npm v3.10.10
npm ERR! cb.apply is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/garamsong/portfolio/practice_redux/redux_first/npm-debug.log
I checked my node version and npm version as well
node is v14.17.0
npm is v3.10.10
I thought It could be my npm version problem, so I tried delete npm.. but it didn't work..
so my question is
is it version of npm problem?
if not, what is the problem?
and how to install redux?
Thanks for reading my stupid question.. but this made me really frustrated..(btw sudo doesn't work at all) 😥

Can't publish VS Code extension anymore after `npm update`?

I just can't publish my extension anymore.
It just worked fine before I ran npm update.
Now it says all day, no matter what:
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "vscode:prepublish"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! eppz-code#1.1.25 vscode:prepublish: `tsc -p ./`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the eppz-code#1.1.25 vscode:prepublish script 'tsc -p ./'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
See dependencies in package.json to get the full picture.
I tried with countless node versions (6.x to 7.x), no luck with any.
Anyone with similar issues ended up in a solution?
Manually deleting entire node_modules content, then reinstall everything (with npm install) simply solved the issue.

electron install error : Failed at the electron#1.4.6 postinstall script 'node install.js'

I'm trying to install electron recent version and encountering this error. I tried installing sudo and did downgrade to electron 1.4.5 but this error persists. node version I'm using is v7.1.0
Complete error log
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "install" "-g" "electron#1.4.5" "--verbose"
npm ERR! node v6.6.0
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! electron#1.4.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.4.5 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.
It turned out to be a problem with the node version I'm using. Possibly electron is not compatible with the newer version of node that is released.
I've installed nvm and installed a lower version of node. In my case v6.3.0. After that I was able to install electron without errors.
had the same issue, also when using sudo.
when i switched to root, the installation worked.

Node 6 debugger windows - Error trying to copy the OSX app icon to customize electron-prebuilt

I just updated to Node v6 (installed latest win executable from their website), and apparently I can't see to use the "debugger" anymore in my projects
Error: Cannot find module 'C:\Dev\myNodeProject\debugger'
I tried to install this package but then I run into errors
npm install debugger --save
electron-prebuilt#1.0.2 postinstall C:\Dev\myNodeProject\node_modules\electron-prebuilt
> node install.js
Downloading electron-v1.0.2-win32-x64.zip
[============================================>] 100.0% of 49.69 MB (407.27 kB/s)
> debugger#0.35.0 postinstall C:\Dev\myNodeProject\node_modules\debugger
> node bin/postinstall.js
Error trying to copy the OSX app icon to customize electron-prebuilt
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "debugger" "--save"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! debugger#0.35.0 postinstall: `node bin/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the debugger#0.35.0 postinstall script 'node bin/postinstall.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the debugger package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs debugger
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls debugger
npm ERR! There is likely additional logging output above.
So is this really a bug that I should report, or am I missing something trivial ? The error mentions OSX but obviously I'm not running that...
I was having similar issues with node v7.8.0 and npm '4.2.0' on Fedora-21.
Investigated around an hour to get the clue to resolving the issue but didn't help much.
However, I come across a module node-inspect which perfectly works for me and serves the purpose I'm looking for.
npm install node-inspect
And then use it like
node inspect my-script.js
For more detail you can refer npm official sites

npm err code eisdir errno -4068 whenever installing any package

I followed this guide to install node to my machine without having admin rights.
I put node.exe, (npm.cmd and node_modules ) both from the npm zip in C:\Users\rakibler\Node. I added that to my path. I ran npm install -g bower and got
npm ERR! Error: EISDIR, open 'C:\Users\rakibler\Node\bower'
npm ERR! at Error (native)
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 Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\rakibler\\Node\\\\node.exe" "C:\\Users\\rakibler\\Node\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\Users\rakibler
npm ERR! node -v v0.12.7
npm ERR! npm -v 1.4.9
npm ERR! path C:\Users\rakibler\Node\bower
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\rakibler\npm-debug.log
npm ERR! not ok code 0
at the end. It also seems like something else is wrong, because everything it downloads goes to C:\Users\rakibler\Node instead of C:\Users\rakibler\Node\node_modules. Not sure what's going wrong here. Any idea?
i think you need to install the npm globlally using
"npm install -g npm"
and then use it in directory to install bower . i hope this will solve your issue

Resources