droledenom
droledenom

Reputation: 225

npm install error EACCES permission denied?

I have permission problem using npm. When I write "npm install"

Error: EACCES: permission denied, mkdir '/ItsMe'
TypeError: Cannot read property 'get' of undefined
    at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:211:17)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:83:20
    at cb (/usr/local/lib/node_modules/npm/lib/npm.js:215:22)
    at /usr/local/lib/node_modules/npm/lib/npm.js:253:24
    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
    at Array.forEach (native)
    at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
    at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
    at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:178:20)
    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:235:20)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:211
  if (npm.config.get('json')) {
                ^

TypeError: Cannot read property 'get' of undefined
    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:211:17)
    at emitOne (events.js:96:13)
    at process.emit (events.js:191:7)
    at process._fatalException (bootstrap_node.js:304:26)

With a "ls -l" I have rwx rights. I don't understand what "Cannot read property 'get' of undefined" means.

I searched on the web and tried several things but it' doesn't work. Could you help me ?

Thank you

Upvotes: 0

Views: 2286

Answers (1)

Sylvain Attoumani
Sylvain Attoumani

Reputation: 1194

Your npm install try to do an mkdir in a file you don't have access to. Try to give him the right by doing

sudo npm install

or doing it as a super user (I dont recomand that) You also asked what npm install do without argument. Well if ou don't specify a folder it creates the folder node_module (that is why it does an mkdir). If you don't precise a module it will install all the module from package.json. It can take morte time and you will have a lots of package you won't need but with that you will be sure to have the one you want.

You can choose the package you want if you exactly know wich one. ie :

npm install sax@latest

the latest mean it gonna search for the last existing package

ANd you can also install a package you downloaded yourself. ie :

npm install ./package.tgz

Upvotes: 1

Related Questions