Get into remote ssh via:
rhc ssh <myapp>
Need to intall a module:
npm install koa --save
Gives the result:
npm http GET https://registry.npmjs.org/koa
npm http 304 https://registry.npmjs.org/koa
npm WARN engine koa#0.19.1: wanted: {"node":">= 0.11.16","iojs":">= 1.0.0"} (current: {"node":"v0.11.11","npm":"1.3.25"})
npm ERR! Error: EACCES, mkdir '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules'
npm ERR! { [Error: EACCES, mkdir '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules']
npm ERR! stack: 'Error: EACCES, mkdir \'/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/var/lib/openshift/55397f875973ca0497xxxxxx/node_modules/koa',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/var/lib/openshift/55397f875973ca0497xxxxxx/app-root/data/node-v0.11.11-linux-x64/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23',
npm ERR! '/var/lib/openshift/55397f875973ca0497xxxxxx/app-root/data/node-v0.11.11-linux-x64/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:97:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
The error says it all: Error: "EACCES, mkdir '/var/lib/....'". npm is trying to make a directory with the 'mkdir' command. Normally this needs specific privileges.
Run the npm install with sudo and you should be good to go!
sudo npm install koa --save
Also it is looking for "node":">= 0.11.16","iojs":">= 1.0.0" and you have "node":"v0.11.11"
Try a version manager like so:
sudo npm install n -g
sudo n 0.4.12 // replace with the version you want
or you could specify 'stable' to get the latest stable build:
sudo npm install n -g
sudo n stable
Related
i am trying to install bower version 1.8.2
globally on my Ubuntu 16.04
but it show that Missing write access /usr/local/bin
i have node 4.2.6
and npm 3.5.2
i get this error:
ubuntu#ubuntu-Inspiron-3521:~/Desktop/Python-2.7.14$ npm install -g bower
npm WARN deprecated bower#1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN checkPermissions Missing write access to /usr/local/lib
/usr/local/lib
`-- bower#1.8.2
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/Desktop/Python-2.7.14/npm-debug.log
ubuntu#ubuntu-Inspiron-3521:~/Desktop/Python-2.7.14$ node --version
v4.2.6
ubuntu#ubuntu-Inspiron-3521:~/Desktop/Python-2.7.14$ npm --version
3.5.2
ubuntu#ubuntu-Inspiron-3521:~/Desktop/Python-2.7.14$
You can install it using sudo:
sudo npm i --global bower
But that is not recommended, hence you can fix your npm permissions like this:
sudo chown -R $(whoami) $(npm config get prefix)/lib/node_modules
You can find a gist for the same here.
I'm trying to install a package using npm install -g PACKAGE_NAME but it is throwing the following error.
npm http GET https://registry.npmjs.org/ionic
npm http 304 https://registry.npmjs.org/ionic
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/ionic',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/nodejs/fstream/lib/writer.js:171:23',
npm ERR! '/usr/lib/nodejs/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
Also when I tried sudo npm install -g PACKAGE_NAME , it executed silently but the package was not installed.
$ sudo npm install -g ionic
npm http GET https://registry.npmjs.org/ionic
npm http 304 https://registry.npmjs.org/ionic
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
ionic#1.7.13 /usr/local/lib/node_modules/ionic
xarvis#xarvis:~/songhop/self$ ionic
/usr/bin/env: node: No such file or directory
Also As stated in an answer on stack overflow I've give write access in node_module directory using sudo chown -R $USER node_modules.
The first error says you are not root. If you want to add node modules as user avoid -g (global) in your npm command.
The second one is saying that it cannot find node. You need to do a symbolic link from nodejs to node while installing nodejs in ubuntu as:
sudo ln -s /usr/bin/nodejs /usr/bin/node
To test your node installation, type in terminal node -v to see the node version number.
So I installed Node.js by downloading the mac 0Sx package from their website, but now every time I try to run a command such as f$ grunt-cli -v I get the following error below. This path /usr/local/bin/npm also doesn't exist on my computer, and I don't know how to find node.js to unistall it, and then re-install it using homebrew. Let me know if I have left any info out.
-bash: grunt-cli: command not found
Sams-MacBook-Pro:~ SamDavidoff$ npm install -g grunt-cli
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /usr/local/lib/node_modules/grunt-cli
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, rmdir '/usr/local/lib/node_modules/grunt-cli'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, rmdir '/usr/local/lib/node_modules/grunt-cli']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/grunt-cli' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir '/usr/local/lib/node_modules/grunt-cli'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, rmdir '/usr/local/lib/node_modules/grunt-cli']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/grunt-cli' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/SamDavidoff/npm-debug.log
EACCES means you don't have root access. Reinstalling node/npm won't help. Like it says, try running it as admin:
sudo npm install -g grunt-cli
Or if you don't want to use sudo, install nvm (note nvm may not allow you to globally install on mac, but it does on ubuntu so it might work):
$ git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
$ ...
$ ~/.nvm/nvm.sh
$ ...
$ nvm install stable
$ ...
$ nvm use stable
$ npm install -g grunt-cli
I'm using nvm running node version 0.12.2.
I try and install bower globally:
karl#karl-laptop:~/www/busarama/src$ npm install -g bower
npm ERR! tar.unpack untar error /home/karl/.npm/bower/1.4.1/package.tgz
npm ERR! Linux 3.16.0-36-generic
npm ERR! argv "/home/karl/.nvm/versions/node/v0.12.2/bin/node" "/home/karl/.nvm/versions/node/v0.12.2/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/home/karl/.nvm/versions/node/v0.12.2/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23',
npm ERR! '/home/karl/.nvm/versions/node/v0.12.2/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/karl/www/busarama/src/npm-debug.log
I am very suspicious it is due to me running this earlier today:
npm config set prefix /usr/local
Does anyone know what the default npm config prefix should be (when installing -g to the local profile, not sudo)? I installed nvm as a local user.
This is affecting everything I try to install globally.
Found this little nice link: https://docs.npmjs.com/files/folders
Local install (default): puts stuff in ./node_modules of the current package root.
Global install (with -g): puts stuff in /usr/local or wherever node is installed.
Install it locally if you're going to require() it.
Install it globally if you're going to run it on the command line.
If you need both, then install it in both places, or use npm link.
...or wherever node is installed.
This means I'm guessing that it should be installed to /home/karl/.nvm/versions/node/v0.12.2 somewhere.
I need to set the npm config prefix to whatever node is running.
I just reinstalled nvm. Seemed to fix the config file.
I already have installed express using
npm install express
but looks like in order too create apps I should install it globally. So I used:
npm install -g express
but received:
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/express']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/express',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/express',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.11.2-201.fc19.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "express"
npm ERR! cwd /home/parisa
npm ERR! node -v v0.10.19
npm ERR! npm -v 1.3.6
npm ERR! path /usr/lib/node_modules/express
npm ERR! fstream_path /usr/lib/node_modules/express
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR! fstream_stack /usr/lib/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/parisa/npm-debug.log
npm ERR! not ok code 0
then after trying sudo:
sudo npm install -g express
I get this:
axconfig: unable to open axports file /etc/ax25/axports (No such file or directory)
why is that???
As the error clearly states, you don't have permissions to create in /usr/lib.
stack Error: EACCES, mkdir '/usr/lib/node_modules/express'
hence install with sudo permissions..
sudo npm install -g express
Are you using fedora?
At least in fedora the "node" package is not node.js, It is an amateur radio utility,
axconfig is a file of that software.
npm is not finding nodejs, it is trying to use the wrong software.
Install nodejs package
sudo yum install nodejs
and remove node package
sudo yum remove node
Now npm must work properly for the super user.
edit: Also in debian repositories, the package 'node' is not nodejs
If you are on Arch Linux, check out the npm2arch package in the AUR. It will let you install npm packages using pacman.
Example:
npm2archinstall express