I\'m trying to install ESLint with npm by going:
npm install -g eslint
However I get the following error:
Deans-Air:~ deangibso
Use --unsafe-perm=true
and --allow-root
flags with npm
install like below:-
sudo npm install -g eslint --unsafe-perm=true --allow-root
it worked like charm for me.
Use sudo before tns and it is work for me
Example:
sudo tns create Tekmo --template tns-template-hello-world
if I have used sudo then not found error like to create postinstall.js
Error: EACCES: permission denied
This problem is well documented in the npm docs: Fixing npm permissions.
You have 2 solutions available:
Option 1: Change npm's default directory to a hidden directory in your home folder
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
Option 2: Use a package manager that takes care of this for you
brew install node
Running the following command solved the issue for me while installing my packages.json :
sudo npm install --unsafe-perm=true --allow-root
To install only the package which caused the issue:
sudo npm install -g --unsafe-perm=true --allow-root eslint
sudo npm install -g --unsafe-perm=true eslint
is sufficient.
For MAC user provide the access permission to project directory folder