如下所示,%AppData%\npm
在系统 Path 变量中添加。我也尝试将它添加到用户路径变量中。该文件grunt.cmd
存在于目录中,但仅当我使用绝对路径指定它时才有效。又名,路径不起作用。
C:\Users\TeamCity>echo %path%
%AppData%\npm;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows
\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\10
0\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program F
iles\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Ser
ver\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Ser
ver\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program
Files\nodejs\
C:\Users\TeamCity>dir %appdata%\npm
Volume in drive C has no label.
Volume Serial Number is B845-1135
Directory of C:\Users\TeamCity\AppData\Roaming\npm
05/29/2013 03:14 AM <DIR> .
05/29/2013 03:14 AM <DIR> ..
05/29/2013 03:14 AM 298 grunt
05/29/2013 03:14 AM 159 grunt.cmd
05/29/2013 03:13 AM <DIR> node_modules
2 File(s) 457 bytes
3 Dir(s) 23,690,498,048 bytes free
C:\Users\TeamCity>grunt
'grunt' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\TeamCity>%appdata%\npm\grunt
grunt-cli: The grunt command line interface. (v0.1.9)
运行:
- Windows Server 2008 R2 数据中心
- 服务包 1
- 64 位