I have installed npm locally in ~/.local
Now, I want to install grunt-cli globally in this local install, but I have this output :
npm ERR! Linux 3.19.0-18-generic
npm ERR! argv "/home/etud/(my name)/.local/usr/bin/node" "/home/etud/(my name)/.local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! path /home/etud/(my name)/.npm/grunt-cli/0.1.13/package/package.json.ee5c5aa03b9d2c7367d767e1d6e17af3
npm ERR! code Unknown system error -121
npm ERR! errno -121
npm ERR! syscall chown
npm ERR! Unknown system error -121: Unknown system error -121, chown '/home/etud/(my name)/.npm/grunt-cli/0.1.13/package/package.json.ee5c5aa03b9d2c7367d767e1d6e17af3'
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/etud/(my name)/npm-debug.log
I've done :
$> npm config set -g user=`whoami`
and put this into ~/.npmrc :
root = /home/(my name)/.local/lib/node_modules
binroot = /home/(my name)/.local/bin
manroot = /home/(my name).local/share/man
Any idea ?
EDIT
I'm on my university machine that are working on nfs systems. It seems I can't call the chown command because of problem of user map.
Is there a way to make npm skip any chown ?
Related
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /.npm
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1001:1001 "/.
How to resolve this, this is a organization server?
Edit: The $whoami is already the owner of all npm related files and folders
I am working on a simple smart mirror project with javascript and electron. I was able to get the software working on my laptop but when I moved it to the raspberry pi I am having issues installing npm. After entering "npm install" I get this:
npm WARN package.json bcrypt-pbkdf#1.0.1 No repository field.
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'types/jquery' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'smart-mirror-server'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 4.9.24-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/Desktop/smart-connected-mirror-master
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Desktop/smart-connected-mirror-master/npm-debug.log
npm ERR! not ok code 0
I have tried
sudo apt-get update
as well as
sudo apt-get upgrade
Any ideas what to do? Thanks!
EDIT:
I updated the node.js to a more current version and now it installed without error. However, when I typed in the command
npm start
I get this:
sh: 1: electron: Permission denied
npm ERR! Linux 4.9.24-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! smart-mirror-server#1.0.0 start: `electron .`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the smart-mirror-server#1.0.0 start script 'electron .'.
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 smart-mirror- server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs smart-mirror-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls smart-mirror-server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/.npm/_logs/2017-05-29T03_33_22_466Z-debug.log
Have you seen this issue? Electron works only on RaspberryPi 2/3 what version are you using?
Also have you run npm install before actually run the app? Sometimes when copying node_modules from OS to OS the executable permissions get very confused.
You can try a fresh install with: rm -rf node_modules && npm install
I have a nodejs docker instance running in Windows.
I have mounted a write-enabled windows directory to the docker instance.
I am trying to install shelljs into my project but it is failing with a following error:
npm ERR! Linux 4.0.9-boot2docker
npm ERR! argv "/opt/nodejs/bin/node" "/usr/bin/npm" "install" "shelljs"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! path ../shelljs/bin/shjs
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../shelljs/bin/shjs' -> '/home/app/meteor-webpack-react/node_modules/.bin/shjs'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Linux 4.0.9-boot2docker
npm ERR! argv "/opt/nodejs/bin/node" "/usr/bin/npm" "install" "shelljs"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! path npm-debug.log.907b6eb81436ba935104c98d206fb37c
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.907b6eb81436ba935104c98d206fb37c' -> 'npm-debug.log'
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/app/meteor-webpack-react/npm-debug.log
Please note that I have enabled symlink creation (http://www.ahtik.com/blog/fixing-your-virtualbox-shared-folder-symlink-error/) and they can be done manually via ln -s. I am running a machine as administrator.
Any idea of why the symlinks are failing. I thought that it is because the npm cache is in the virtual machine trying to symlink to windows directory, but trying to move cache to windows directory failed as well (npm config set cache ~/.npm --global)
Have you made sure you have installed Virtualbox Extension Pack for the right version of VirtualBox? Usually that is the culprit.
I installed some nodejs packages globally via
sudo npm install gulp -g
Now I (or another developer on the same machine) wants to use it in a project with
me#host:/my/project$ npm link gulp
It fails with
unbuild gulp#3.8.11
npm ERR! Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js'
npm ERR! { [Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: '/my/projectnode_modules/gulp/bin/gulp.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.2.0-4-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "link" "gulp"
npm ERR! cwd /raid5/workspaces/jgr/aktivglueck-laravel
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /my/projectnode_modules/gulp/bin/gulp.js
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /my/projectnpm-debug.log
npm ERR! not ok code 0
With
sudo npm link gulp
everything works fine.
What I want to know is: Why does npm link need admin permissions? In my understanding I am creating a link inside my project folder where I have full permissions - so what does it do on the global system?
I believe npm link creates a symlink to the current directory in wherever your globally installed node packages are. See here.
If you don't have write rights to that path (you can check with npm config get prefix) you'll get the error you see there.
To avoid having to sudo global installs/links, you could change the ownership/rights of that directory.
I get an error when trying to install gruntjs on a linux 12.04 (with a mirrored packages source)
Here is the error:
sudo npm install -g grunt-cli
npm ERR! Error: ENOENT, open '/home/havetl/.npm/d63f3d0b-grunt-cli.lock'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /home/havetl
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path /home/havetl/.npm/d63f3d0b-grunt-cli.lock
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /home/havetl
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/havetl/npm-debug.log
npm ERR! not ok code 0
Thanks for any idea!
According to the maintainer of npm, installing packages with sudo is considered bad practice because you are allowing that package to have complete control of your system and you can't and SHOULDN'T trust these packages with root access. Think Debian's long release cycles as an extreme example of protecting end users from community maintained packages for this exact reason.
http://howtonode.org/introduction-to-npm
You should do what Issaacs suggests and chown your /usr/local folder so you have RW permissions.
I've had this problem before; sometimes for global packages your current working directory has to be ~/ (but I'm not sure why this is!). Try:
cd ~/; sudo npm install -g grunt-cli
This blog worked for me :
http://slopjong.de/2012/10/31/how-to-install-the-latest-nodejs-in-ubuntu/
the error was because in ubuntu v12 few of the dependencies were not available for the latest version of Node.