Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

windows - The term 'node' is not recognized... In Powershell

I have been trying to resolve this issue for the whole day.

When I run node -v or npm install in cmd prompt, it works absolutely fine. But when I run the same commands in Powershell, it gives the following error:s

PS C:UsersAnubhav.Trivedi> node -v
The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelli
ng of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:5
+ node <<<<  -v
    + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I tried uninstalling node js and reinstalling it. Added node js path C:Program Files (x86) odejs to enviroment variables (system variables). Restarting computer. But nothing seems to work. Kindly let me know, what am I missing here.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

These issues cannot be installed from the Package Manager console, so I had to browse lot of things to fix the issues and finally I got the solution.

Maybe we followed these scenarios

  • Missing Node.js software

  • Wrongly updated Windows environment path

  • Installed in the wrong path

  • Old version of Node.js software

You can download the latest Node.js software here.

Update Path

After installation, automatically create nodejs folder in this path “C:Program Files (x86)” or “C:Program Files “.

Open Control Panel -> User Accounts -> Change my environmental variable and verify the path Variable value “C:Program Files (x86) odejs” or “C:Program Files odejs “.

new => user = path => value = C:Program Files (x86) odejs and after apply that.

and close Editor and restart it. it will work correctly.

note :- enter your path instead of copy of this path.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...