Sudo没找到.尝试npm安装

Web*_*uin 3 windows sudo node.js

我使用的是Windows 8.1笔记本电脑.我一直没有找到sudo.使用以下命令尝试npm install:

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
git@0.1.5 C:\Users\Dave\AppData\Roaming\npm\node_modules\git
??? mime@1.2.9

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
sudo@1.0.3 node_modules\sudo
??? inpath@1.0.2
??? pidof@1.0.2
??? read@1.0.5 (mute-stream@0.0.4)

F:\Webruin2>sudo npm install -g git
'sudo' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)

请让我知道最好的方法.如果这不是主题,请帮我回到主题.;)

蒂姆

dli*_*ley 7

Windows命令提示符(cmd.exe)无法识别"sudo"命令,因为"sudo"是基于Unix/Linux的应用程序,仅与该特定操作系统兼容.Windows当前不包含或支持此命令.

在Unix/Linux操作系统上,"sudo"是一个用于临时获取另一个用户(通常是root/administrator)安全权限的应用程序,通常用于软件或驱动程序安装,类似于运行Windows命令提示符作为管理员.

根据您发布的输出,npm已经显示在您的系统上(如执行"npm install -s sudo"所示),因此您应该能够使用命令"npm install $ modulename"安装npm模块",'$ modulename'将替换为您要安装的模块或库的名称.

如果您尝试在Windows平台上安装Git,我建议您使用以下相应的安装程序:http://git-scm.com/download