I type npm install -g karma and get the following result every time I try:
npm ERR! tar.unpack untar error /Users/Sasha/.npm/karma/0.13.10/package.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "karma"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! path /usr/local/lib/node_modules/karma
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/karma'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/karma']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/karma',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/karma',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82: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! /Users/Sasha/npm-debug.log
Please help!Cannot proceed with my tutorial book!
It's a permissions error. Run the command as the root user (as it clearly suggests in the error):
sudo npm install -g karma
Related
I try to install a Firebase in npm but It's not works well.
I only copy and paste $ npm install -g firebase-tools.
After I got this message
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "firebase-tools"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! path ../lib/node_modules/firebase-tools/bin/firebase
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/bin/firebase' -> '/usr/local/bin/firebase'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/bin/firebase' -> '/usr/local/bin/firebase'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/firebase-tools/bin/firebase',
npm ERR! dest: '/usr/local/bin/firebase' }
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! /Users/hansangjun/npm-debug.log
npm ERR! code 1
You are running it as normal user. Run the same with following command
sudo npm install -g firebase-tools
I am installing create-react-app through terminal. I have checked the node.js version is 4.5.0, which is higher than the requirement here. and the version of npm is 2.15.9. Then I type the command npm install -g create-react-app, there came out such error information:
npm ERR! tar.unpack untar error /Users/xiufenxu/.npm/create-react-app/0.6.0/package.tgz
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! path /usr/local/lib/node_modules/create-react-app
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/create-react-app'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/create-react-app']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/create-react-app',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/create-react-app',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82: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! /Users/xiufenxu/Documents/UM courses/Fall 2016/CSCI 5117/npm-debug.log
I wondering why I got such errors. Is there anyone who can help me to figure out this problem? Thank you so much!
sudo npm install -g create-react-app
you're running it as a user without root permissions
Restarting my computer fixed it for me
I'm trying to make my nodejs project work on aws-ec2.
I've a permission issue trying to install bower:
npm ERR! tar.unpack untar error /home/ec2-user/.npm/bower/1.7.7/package.tgz
npm ERR! Linux 4.1.17-22.30.amzn1.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/bower'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/bower']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/bower',
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! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82: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/ec2-user/www/npm-debug.log
And when I try to sudo the command I get
sudo: npm: command not found
SOLUTION
I solved with the Option 1 here
https://docs.npmjs.com/getting-started/fixing-npm-permissions
If you get
sudo: npm: command not found
then you have to add it to your PATH variable.
In ElasticBeanstalk like this:
export PATH=/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin:$PATH
I created a new user on my Mac and tried this. This normally works in my other account. This new user is an administrator also.
npm ERR! tar.unpack untar error /Users/test/.npm/webpack/1.11.0/package.tgz
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "webpack"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path /usr/local/lib/node_modules/webpack
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/webpack'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/webpack']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/webpack',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/webpack',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47: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! /Users/test/WebstormProjects/babel-test/npm-debug.log
I am not very good with the UNIX stuff and things, I just wish these things would be more easy.
From the looks of it, since it says EACCES, it is probably getting an access denied from the system. If you are installing globally on unix you must use sudo.
$ sudo npm install -g webpack
Start using nvm and it will save you from using sudo at all.
https://github.com/creationix/nvm
I'm confused by this problem
My OS is
CentOS 7
my account can exec sudo
I download the nodejs node-v0.10.31-linux-x64.tar.gz for 64-bit linux from the official nodejs site and put it under the /usr/tools, unzip the file and then put the node path to PATH, the npm and node exec file is in the folder /usr/tools/node-v10/bin
the result like
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/lawrence/bin:/usr/tools/node-v10/bin
I exec the command:
sudo npm install -g bower or the sudo npm install bower
the error occurs:
sudo: npm: command not found
and when exec the command:
npm install -g bower or the npm install bower
the error occurs like:
npm ERR! Error: EACCES, mkdir '/usr/tools/node-v10/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/tools/node-v10/lib/node_modules/bower']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/tools/node-v10/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/tools/node-v10/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/tools/node-v10/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/tools/node-v10/lib/node_modules/npm/node_modules/mkdirp/index.js:46: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.10.0-123.6.3.el7.x86_64
npm ERR! command "/usr/tools/node-v10/bin/node" "/usr/tools/node-v10/bin/npm" "install" "bower" "-g"
npm ERR! cwd /usr/tools/node-v10/bin
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /usr/tools/node-v10/lib/node_modules/bower
npm ERR! fstream_path /usr/tools/node-v10/lib/node_modules/bower
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/tools/node-v10/lib/node_modules/bower'
npm ERR! fstream_stack /usr/tools/node-v10/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/tools/node-v10/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
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.10.0-123.6.3.el7.x86_64
npm ERR! command "/usr/tools/node-v10/bin/node" "/usr/tools/node-v10/bin/npm" "install" "bower" "-g"
npm ERR! cwd /usr/tools/node-v10/bin
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
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! /usr/tools/node-v10/bin/npm-debug.log
npm ERR! not ok code 0