windows - 在 Windows 上运行 grunt.cmd 的多个问题

标签 windows node.js gruntjs

我不得不修改 grunt.cmd 因为我的系统路径非常错误:

原来:

%~dp0\Application Data\npm\node_modules\grunt

哪个会打印:

\\dacwnas\Profiles\\Application Data\npm\Application Data\npm\node_modules\grunt

运行 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/

相关文章:

windows - Get-ChildItem 相当于 DIR/X

javascript - neo4j javascript/nodejs 驱动程序未调用 onCompleted 或 onError

node.js - Pug/Jade 模板引擎 : html beautifier?

javascript - QUnit 失败并发出咕噜声,在浏览器中通过

javascript - gruntfile错误,什么问题?

c - 是否有分发适用于 Windows 的 native C 库的最佳实践指南?

c++ - SuspendThread WOW64 在内核代码中挂起

caching - grunt-cache-breaker 不重命名 revved 文件

c++ - 试图解释 Windows 操作系统上的用户 session 状态

javascript - Angular - 路由为什么我的 Controller 被调用两次