找不到有效的 Gruntfile
A valid Gruntfile could not be found
我按照此 link 尝试在 ubuntu 服务器上安装 mean.js
堆栈。
关于grunt
,在/opt/mean
,我已经做了
sudo npm install -g bower grunt-cli
sudo npm install grunt --save-dev
sudo npm install
但是,文件夹内的 grunt
或 grunt jshint
给出
A valid Gruntfile could not be found. Please see the getting started
guide for more information on how to configure grunt:
http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.
注意 npm start
有效,http://server_domain_or_IP:3000
可以显示示例应用程序。
有谁知道如何修复 grunt 错误?
如错误所述,您没有 G运行t 文件,https://gruntjs.com/getting-started 显示了一个示例。
仅仅安装 G运行t 是不够的。当你 运行 grunt
它需要一个配置文件(你的 G运行t 文件)来 运行 任何任务。 G运行t 文件本身包含要 运行.
的任务
您的项目中需要 Gruntfile.js。您可以使用以下 grunt 命令创建相同的内容。
grunt-init gruntfile
以上命令将在您的项目中创建示例 gruntfile.js 文件。
我按照此 link 尝试在 ubuntu 服务器上安装 mean.js
堆栈。
关于grunt
,在/opt/mean
,我已经做了
sudo npm install -g bower grunt-cli
sudo npm install grunt --save-dev
sudo npm install
但是,文件夹内的 grunt
或 grunt jshint
给出
A valid Gruntfile could not be found. Please see the getting started guide for more information on how to configure grunt: http://gruntjs.com/getting-started Fatal error: Unable to find Gruntfile.
注意 npm start
有效,http://server_domain_or_IP:3000
可以显示示例应用程序。
有谁知道如何修复 grunt 错误?
如错误所述,您没有 G运行t 文件,https://gruntjs.com/getting-started 显示了一个示例。
仅仅安装 G运行t 是不够的。当你 运行 grunt
它需要一个配置文件(你的 G运行t 文件)来 运行 任何任务。 G运行t 文件本身包含要 运行.
您的项目中需要 Gruntfile.js。您可以使用以下 grunt 命令创建相同的内容。 grunt-init gruntfile
以上命令将在您的项目中创建示例 gruntfile.js 文件。