ESlint Error Install from Command Line

It looks like you're trying to install globally while your user doesn't have access to the global node_modules folder. You can try installing it as root or chown '/usr/local/lib/node_modules'.

Install as root -

    sudo npm install -g eslint

Chown -

    chown user:group /usr/local/lib/node_modules
    npm install -g eslint

You can also change permissions to /usr/local/lib/node_modules to allow your user access using chmod.

Edit: Try the solution in the answer here "Permission Denied" when trying to install ESlint on OSX globally

Add this to ~/.npmrc:

prefix = ${HOME}/.npm-packages https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md You also have to add ${HOME}/.npm-packages/.bin to your PATH so that your shell knows where to look up the globally installed scripts.


If you're getting eslint: command not found try:

./node_modules/.bin/eslint --init

Try

npm install eslint --save-dev and then eslint --init.

Let me know if you face any issues.