I'm trying to install jshint to use with Sublime. I've successfully installed node.js and have installed SublimeLinter and SublimeLinter-jshint packages but whenever I type npm install -g jshint
into terminal, I get the following:
have tried using npm cache clean but it doesn't work.
As the error message clearly says, you need to run the command as root/Administrator. Prepend your command with sudo:
sudo npm install -g jshint
(assuming you have Administrator access), enter your password at the prompt, and the install will proceed.
Related
I installed nodejs v8.11.2 and npm v5.6.0 using the command nvm install 8.11.2.
When I opened my system after shutting it down for a while my system and wrote npm -v in the terminal, it said npm is not installed, and to install it with sudo apt install npm.
However when I again entered nvm install 8.11.2, it said that nodejs and npm are already installed and it began using it. Sometimes when opening a different terminal, npm -v says that npm is not installed. And later when I used the command sudo npm install, the output came:
sudo: npm: command not found
So I installed npm with sudo apt-get install npm, but it installed npm v3.5.2 and updating it with npm install npm#latest -g did nothing, i.e., it remained npm v3.5.2.
I need npm v5.6.0 for a project of mine and is clueless on how to get this issue sorted. Please help.
(nvm maintainer here)
sudo is not, and must not be, used with nvm. nvm is per-user, per-shell.
npm should not be installed by itself; it comes with node. You should apt-get remove it.
If nvm isn't being loaded properly on a new shell, try rerunning the install script, then file an issue on http://nvm.sh, and I'll be happy to help you directly.
NPM doesn't -g as a command there for I'm unable install anything globally.
Anyways this behavior only for the Command Prompt when I do the same in Bash
It works fine.
Why this happens?
Trying to install BrowserSync
I've followed the steps to install the package through the command line, installed node.js and then I went on to install npm through the command line.
Now when I try to install browser-sync with the following line npm install -g browser-sync you will see it is not recognized when I check the version and its the same when I try do anything like start --server?
note tried installing another package as a test jshint successfully installs/uninstalls but displays the same message when checking its version.
Any suggestions?
Have you tried like below? (http://www.browsersync.io/#install)
npm install -g browser-sync
-g means global.
I have installed npm and installed grunt, but when i run grunt, it says 'grunt' is not recognized as an internal or external command.
I done the below steps in command prompt
npm install
npm install -g grunt-cli
PATH variable and grunt folder are available but still i am not able to run grunt.
Please provide me a solution for this
You have only installed the command line interface.
Use npm install -g grunt to install the actual program.
Here's what I've done so far:
brew install nodejs npm
npm install -g grunt
I've also set up my path to include the proper directories. When I run echo $PATH I get:
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/lib/node:/usr/local/lib/node_modules:/usr/local/share/npm/bin:/usr/local/share/npm/lib/node_modules:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/landonschropp/.rbenv/shims:/usr/local/sbin:/usr/local/lib/node:/usr/local/lib/node_modules:/usr/local/share/npm/bin:/usr/local/share/npm/lib/node_modules:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
The installation succeeds without any problems. However, if I try to run grunt I get this error:
zsh: permission denied: grunt
Did I miss a step?
Try installing the command line interface:
npm install -g grunt-cli
sudo npm install -g grunt-cli and then type your password.