如何在Win7上使用git-bash/mingw32 npm安装 [英] How to npm install with git-bash/mingw32 on win7

查看:153
本文介绍了如何在Win7上使用git-bash/mingw32 npm安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在win7上使用git-bash/mingw32.我正在尝试安装npm:

I am using git-bash/mingw32 on win7. I am trying to install npm:

$ npm install
sh: npm: command not found.

Git-bash正常工作并且已正确安装.我该如何进行这项工作?

Git-bash is working normally and is installed correctly. How can I make this work?

推荐答案

此行为有两个原因:

1)未安装npm

2)npm不在%PATH%

2) npm not in %PATH%

您可以通过以管理员身份运行cmd(win + r-> cmd)并执行以下命令来将npm添加到%PATH%:

You can add npm to %PATH% by running cmd (win+r -> cmd) as administrator and execute:

SET PATH=%PATH%;c:\here\is\path\to\npm\dir

之后-再次尝试运行npm.

After that — try run npm again.

这篇关于如何在Win7上使用git-bash/mingw32 npm安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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