Durgesh Narayan
Durgesh Narayan

Reputation: 96

EACCES issue, When i am installing ember-cli

When i'm installing ember-cli with this command "npm install -g ember-cli" showing this error in terminal.

npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/ember-cli'
npm ERR!  { [Error: EACCES, mkdir '/usr/lib/node_modules/ember-cli']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/lib/node_modules/ember-cli',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/lib/node_modules/ember-cli',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR!      '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR!      'Object.oncomplete (fs.js:108:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.13.0-48-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "ember-cli"
npm ERR! cwd /home/narayand4
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! path /usr/lib/node_modules/ember-cli
npm ERR! fstream_path /usr/lib/node_modules/ember-cli
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/ember-cli'
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:108: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.13.0-48-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "ember-cli"
npm ERR! cwd /home/narayand4
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
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/narayand4/npm-debug.log
npm ERR! not ok code 0

please suggest me what i doing wrong?

Upvotes: 1

Views: 7529

Answers (5)

AbirZayn
AbirZayn

Reputation: 150

Im typically the owner of my linux system or computer. I had some error while writting

npm install -g firebase-tools

and got EACSSES types of error. Then I tried the same thing with sudo npm install -g firebase-tools

and it sorted out.

Upvotes: 0

Awara Amini
Awara Amini

Reputation: 572

This worked for me

 sudo npm install -g eas-cli

Upvotes: 0

locks
locks

Reputation: 6577

This is a known issue with some installers, here's the documentation on fixing npm permissions.
If you're curious to learn more, the npm developers have recently talked about it on JavaScript Jabber #174.

Upvotes: 5

Durgesh Narayan
Durgesh Narayan

Reputation: 96

I have researched on google the main issue was npm installation. I think, does not require "sudo" for npm installation.

Upvotes: 0

Tom
Tom

Reputation: 979

The -g flag to node does a global install on the machine. As such it requires permissions to write at least to /usr/lib.

So if you want to install with the -g option, do so as an administrative user, usually root. Sudo is a good way of doing that.

If you are not the administrator of the machine or are otherwise trying to install in your local directory, remove the -g flag.

If you are not the administrator and need it installed globally, contact your system administrator.

Upvotes: 0

Related Questions