Yalda
Yalda

Reputation: 684

"Permission Denied" when trying to install ESlint on OSX globally

This is what I'm trying to do on my mac: npm install eslint -g

And I get a EACCES: permission denied with the following details:

npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'unlink',
npm ERR!   path: '/HOME/.node_modules_global/lib/node_modules/eslint/LICENSE' }

How can I install ESlint globally without using sudo? Or should I use sudo?

Upvotes: 1

Views: 3379

Answers (1)

leesei
leesei

Reputation: 6070

Add this to ~/.npmrc:

prefix = ${HOME}/.npm-packages

https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

Also do search before you ask:
npm global path prefix
NPM modules won't install globally without sudo

Upvotes: 2

Related Questions