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?
Related
I have a shell script where I am installing the npm using nvm. Since after my installation of nvm, it installs the npm using nvm install node -> nvm use <version>.
After this, I have npm cache clean, which cannot recognize the command npm. Since I know that, for getting the node to work in the terminal, we need to restart. But I have upcoming commands in the shell for which bash cannot stop, hence I get errors, cos I am using npm to install other software tools.
Error is: npm command is not found.
Shell Script
# This is for the running the project
#!/bin/bash
# Install NodeJS using nvm
nvm install node
nvm install 11.12.0
nvm use 11.12.0
# Install Cordova and Ionic
npm cache clean
sudo npm install -g cordova#8.1.2 ionic
Is there anyway that I can continue the process without restarting terminal for command process? Any help would be appreciated.
Try call npm with help nvm exec npm
nvm exec cache clean
nvm exec npm install -g cordova#8.1.2 ionic
Don't use sudo in script. Run your script with needed for running rights. Or run shell script with help sudo
I installed npm and node via command
brew install node successfully. And the terminal showed the version of npm and node when I typed in node -v and npm -v.
However, when I tried to install Karma via sudo npm install -g karma, the terminal showed npm:command not found. And I turned to /usr/bin, there was no npm there.
What's wrong with my installation? Thanks!
I followed the strongloop pre installation requirments (http://docs.strongloop.com/display/SL/Installing+Node+and+StrongLoop+on+Windows) and everything was set without problems. However , each time I execute
npm install -g npm
the installation fails. In the npm-debug.log I see the reason for the failure is
info sqlite3#3.0.5 Failed to exec install script
sqlite3 was installed successfully in the global modules.
I opened my CMD in administrator's mode, and by default it opens in
c:\Windows\system32
executing
c:\Windows\system32> npm install -g strongloop
fails with the error in the question. However, executing from the C:\ is OK.
C:\> npm install -g npm
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.
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.