'npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program
Solution 1:[1]
I searched a lot of time and found solutions.
once installed nodejs -> Kindly restart the laptop
then set the path (system properties -> environment settings -> C:\Program Files\nodejs)
now open cmd and type -> C:\Users\solomon\Desktop\react-project>npm start
it will work by opening browser with http://localhost:3000
or
if npm not works in Visual studio code
open vs code then Ctrl+P -> type - ext install npm script runner
you have to choose one and install it.
once installed please close and open Visual studio code
and go to vs code terminal and type npm start and browser will start http://localhost:3000
Wow its works great.
Solution 2:[2]
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
- npm install
-
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Solution 3:[3]
I'm using nvm for the usage of the different versions of node. As a fresh installation, I've installed node version X but didn't apply "use" command for this node version.
Command "nvm ls" should return an asterisk before the current node version.
Solution 4:[4]
I got a similar situation like run on windows shell throws error but run on other bash terminal gets running successfully
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Solomon Suraj |
Solution 2 | Skîllêt Real |
Solution 3 | Alkemichar |
Solution 4 | A.K.J.94 |