NPM problem
You can fix this problem using one of three options:
1).Change the permission to npm default directory.
2).Change npm default directory to another directory.
3).Install node with a package manager that takes care of this for you.
Before moving, you must back up your computer.
Option 1: change permissions to npm default directory
1). Find the path to the npm directory:
npm config get prefix
For many systems, this will be / usr / local.
. /usr, 2 .
2). npm- ( !):
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
, npm (lib/ node_modules, bin share).
2: npm
, npm (,/usr), , , .
npm . .
1). :
mkdir ~/.npm-global
2). npm :
npm config set prefix '~/.npm-global'
3). ~/.profile :
export PATH=~/.npm-global/bin:$PATH
4). :
source ~/.profile
. sudo.
npm install -g jshint
2-4 ENV (, ~/.profile):
NPM_CONFIG_PREFIX=~/.npm-global
3. , .
node Mac OS, , Homebrew. "Homebrew" .
brew install node