I want to install pm2 globally to run my nodejs app. my os is ubuntu 14.04 64bit and node version 0.10.33.
when i run the command npm install pm2 -g it gives the following error
npm ERR! pm2#0.11.1 preinstall: `bash ./scripts/preinstall.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pm2#0.11.1 preinstall script.
npm ERR! This is most likely a problem with the pm2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bash ./scripts/preinstall.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls pm2
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-36-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pm2" "-g"
npm ERR! cwd /home/ubuntu
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
ubuntu#ip-172-31-40-58:~$
Try adding sudo
sudo npm install pm2 -g
or
sudo npm install pm2 -g --unsafe-perm
Related
I want to install pm2 on my rasspberry pi 3:
npm install -g pm2
but i get this error:
(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
I try to add sudo before the command but nothing change.
You need to update npm.
Use the following command and try again:
npm install -g npm#latest
I am trying to move node js application from windows machine to linux machine for QA environment and I am having trouble installing couchbase module on linux machine.
It ran fine on windows machine but I've tried this install on 4 different linux machine and I get this error message when I run
npm install couchbase --no-bin-links
I am on precise32 with vagrant for this logs.
couchbase#2.1.3 install /vagrant/MBO 2122016/node_modules/couchbase
prebuild --install
sh: 1: prebuild: not found
npm ERR! Linux 3.2.0-23-generic-pae
npm ERR! argv "/home/vagrant/.nvm/versions/node/v5.3.0/bin/node" "/home/vagrant/.nvm/versions/node/v5.3.0/bin/npm" "install" "couchbase" "--no-bin-links"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! couchbase#2.1.3 install: `prebuild --install`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the couchbase#2.1.3 install script 'prebuild --install'.
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 couchbase package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild --install
npm ERR! You can get their info via:
npm ERR! npm owner ls couchbase
npm ERR! There is likely additional logging output above.
npm ERR! Linux 3.2.0-23-generic-pae
npm ERR! argv "/home/vagrant/.nvm/versions/node/v5.3.0/bin/node" "/home/vagrant/.nvm/versions/node/v5.3.0/bin/npm" "install" "couchbase" "--no-bin-links"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! path npm-debug.log.6258c2ba9fb733156e17534450091eff
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
I have posted npm-debug I got from this command to pastebin
http://pastebin.com/TtPFCSYf
You cannot install it with --no-bin-links on clean environment, because it relies on prebuild binary being accessible. To workaround it, you have to either remove this switch at all, or install prebuild before couchbase without it:
npm install prebuild
npm install couchbase --no-bin-links
I'm trying to make an openshift MEAN stack application. I'm running npm install -g meanio
however it keeps throwing the following NPM errors:
npm ERR! addLocal Could not install /usr/local/lib/node_modules/meanio/lib/core_modules/server
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! No version provided in package.json
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! /usr/local/lib/node_modules/meanio/lib/core_modules/server/npm-debug.log
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "meanio"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! meanio#0.8.83 postinstall: `cd ./lib/core_modules/server && npm install && cd ../../..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meanio#0.8.83 postinstall script 'cd ./lib/core_modules/server && npm install && cd ../../..'.
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 meanio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cd ./lib/core_modules/server && npm install && cd ../../..
npm ERR! You can get their info via:
npm ERR! npm owner ls meanio
npm ERR! There is likely additional logging output above.
Any help or questions are appreciated.
The preferred way to create MEAN app is via mean-cli
$ npm install -g mean-cli
$ mean init <myApp>
$ cd <myApp> && npm install
Make sure you have prerequisites installed.
http://learn.mean.io/
When i run a command with -g (global) installation i get EACCESS errors . I read on one of the stack overflow answers that i should use 'sudo chown -R whoami ~/.npm' to run as local/root adminstrator but it didnt help
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/.node/lib/node_modules/bower/.editorconfig'
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/Documents/tutorials/bookingappdemo
npm ERR! node -v v0.10.29
npm ERR! npm -v 2.0.0-alpha-5
npm ERR! path /Users/.node/lib/node_modules/bower/.editorconfig
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/Users/.node/lib/node_modules/bower/.editorconfig'
npm ERR! Additional logging details can be found in:
npm ERR! not ok code 0
If you are an administrator I suggest you run the command as root:
sudo npm install -g bower
I used --unsafe-perm with install e.g
sudo npm install -g learnyounode --unsafe-perm
this helped me install without permissions error, hope this is fixed soon.
I'm trying to install some npm modules and all goes fine until I try to install the dependencies of the installed modules. npm shows this log:
$ sudo npm install -g
npm ERR! addLocal Could not install .
npm ERR! Error: ENOENT, open 'package.json'
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 Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
npm ERR! cwd /Users/roemerbakker
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.21
npm ERR! path package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/roemerbakker/npm-debug.log
npm ERR! not ok code 0
$
Also tried the command without -g but it doesn't work either.
There is no need for this. When you install a npm package with npm install <package name> (globally or locally), it already installs all of its dependencies on its own.
You only need the npm install command when you checked out an Application with a package.json-File to install the APPLICATIONS Dependencies.
If you want to upgrade ALL global packages, you should use:
npm update -g