[英]Why is this error coming? I have node.js installed already
因此,我在 Visual Studio Code - Insiders 的终端中输入npm init
,结果如下:
npm init
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 init
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我的电脑上确实有最新版本的 node.js 和 VSC Insiders。 任何帮助将不胜感激:)
这是因为系统无法支持节点包。 您应该尝试在系统环境变量中设置下载节点 package 的路径。
C:\{{ your system path to nodejs }}\nodejs\
到系统属性环境变量的“用户变量”部分的路径变量的末尾。
尝试以下解决方案:
C:\Users\<USERNAME>\AppData\Roaming\npm
添加到您的 PATH 环境变量(替换为您的用户名)。 要访问环境变量,请执行以下操作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.