Error: EACCES: permission denied, mkdir '/home/anit/Desktop/theInjuredLion/natours/node_modules/inotify/build'

0

I am facing this issue while installing node-sass package I have tried using sudo command but same error prevails

Anit Aggarwal

Posted 2019-09-17T23:06:56.183

Reputation: 1

Answers

0

TL;DR

sudo npm install -g package_name

Real solution

On the command line, in your home directory, create a directory for global installations:

mkdir ~/.npm-global

Configure npm to use the new directory path:

npm config set prefix '~/.npm-global'

Add the following line to your ~/.bashrc export PATH=~/.npm-global/bin:$PATH

On the command line, update your system variables:

source ~/.bashrc

To test your new configuration, install a package globally without using sudo:

npm install -g YOUR_NPM_PACKAGE

alessiosavi

Posted 2019-09-17T23:06:56.183

Reputation: 235