'npm' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'npm' is not recognized as an internal or external command, operable program or batch file

查看:2880
本文介绍了'npm' 不是内部或外部命令,也不是可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到:

'npm' is not recognized as an internal or external command, operable program or batch file.

当我发出:

npm install -g bower polyserve

即使我已经下载了 node.

推荐答案

我觉得你没有在系统属性的环境变量中定义nodejs的路径.

I think you have not defined the path of nodejs in Environment Variables on the System Properties.

添加 ;C:\Program Files\nodejs\(你的nodejs安装目录的路径)

Add ;C:\Program Files\nodejs\ (path of your nodejs installed directory)

到系统属性环境变量用户变量"部分的路径变量的末尾.

To the end of your Path variable on the "User variable" section of the Environment Variables on the System Properties.

然后重新打开 cmd 提示符并再次输入 npm.它现在应该可以工作了.希望它有所帮助.

Then reopen cmd prompt and type npm again.It should work now.Hope it helps.

如果还是不行,你可以再做一件事.安装节点后重启你的机器.

You can do one more thing if still it does not work.Reboot your machine after installing node.

这篇关于'npm' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆