我不得不修改 grunt.cmd 因为我的系统路径非常错误:
原来:
%~dp0\Application Data\npm\node_modules\grunt
哪个会打印:
\\dacwnas\Profiles\
运行 grunt.cmd 会抛出找不到模块错误。将其更改为 %~dp0\node_modules\grunt"
可以消除错误。
但是,在 Windows 中运行 grunt.cmd --version
什么也不会输出。它只是暂停片刻,然后返回到空白命令行。
我运行的是 Windows 7 64 位,命令行以管理员身份运行
最佳答案
首先,您应该全局安装 grunt-cli
包:
npm install -g grunt-cli
接下来,确保您的项目文件夹中安装了 grunt
。
您可以这样做:
- 确保
grunt
是您的package.json
的一部分并运行:npm install
- 转到您的项目文件夹,然后只需
npm install grunt
在此之后,运行 Grunt 应该不会有任何问题。
关于windows - 在 Windows 上运行 grunt.cmd 的多个问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12784042/