2015-04-12 179 views
3

我正在使用Windows 8.1笔记本电脑。我一直在找不到sudo。尝试使用以下命令安装npm:没有找到Sudo。尝试npm安装

F:\Webruin2>sudo npm install -g git 
'sudo' is not recognized as an internal or external command, 
operable program or batch file. 

F:\Webruin2>npm install -g git 
[email protected] C:\Users\Dave\AppData\Roaming\npm\node_modules\git 
└── [email protected] 

F:\Webruin2>git -v 
'git' is not recognized as an internal or external command, 
operable program or batch file. 

F:\Webruin2>npm install -s sudo 
[email protected] node_modules\sudo 
├── [email protected] 
├── [email protected] 
└── [email protected] ([email protected]) 

F:\Webruin2>sudo npm install -g git 
'sudo' is not recognized as an internal or external command, 
operable program or batch file. 

请让我知道最好的处理方式。如果这是脱离主题,请帮助我回到主题。 ;)

+1

Sudo是一个内置的unix/linux命令,所以我不确定你的Windows机器如何理解它。 我知道这听起来很猥琐,可能不是你要找的答案,但我诚实的建议是把你的Windows计算机放在..基本上其他任何东西。如果你能负担得起,一本macbook是很好的,但如果不能,你可能会有更好的开发经验,在VirtualBox中运行ubuntu。 –

回答

7

拉斐尔说,须藤将不会被Windows的CMD认可。鉴于npm似乎安装在您的系统上(如成功执行“npm install -s sudo”所见),您应该可以使用命令“npm install modulename”来安装模块

如果您尝试要在本地Windows平台上安装Git,我推荐使用以下适当的安装程序:http://git-scm.com/download