Javascript “咕噜”;Gruntfile.js“;任务…错误

Javascript “咕噜”;Gruntfile.js“;任务…错误,javascript,node.js,amazon-ec2,gruntjs,npm,Javascript,Node.js,Amazon Ec2,Gruntjs,Npm,新加入NPM和grunt。不确定到底发生了什么?你知道如何调试吗?安装了NPM和BOWER我认为,在运行grunt之前,您没有运行NPM install来安装项目的所有软件包。在正常情况下,构建Grunt应用程序。我们应该按照以下步骤运行: 安装NPM软件包 pm WARN EPACKAGEJSON partnerportal@0.0.0 No description npm WARN EPACKAGEJSON partnerportal@0.0.0 No license fie

新加入NPMgrunt。不确定到底发生了什么?你知道如何调试吗?安装了NPMBOWER

我认为,在运行
grunt
之前,您没有运行
NPM install
来安装项目的所有软件包。在正常情况下,构建Grunt应用程序。我们应该按照以下步骤运行:

安装NPM软件包

    pm WARN EPACKAGEJSON partnerportal@0.0.0 No description
    npm WARN EPACKAGEJSON partnerportal@0.0.0 No license field.
    >> Local Npm module "grunt-autoprefixer" not found. Is it installed?
    >> Local Npm module "grunt-concurrent" not found. Is it installed?
    >> Local Npm module "grunt-contrib-concat" not found. Is it installed?
    >> Local Npm module "grunt-contrib-connect" not found. Is it installed?
    >> Local Npm module "grunt-contrib-htmlmin" not found. Is it installed?
    >> Local Npm module "grunt-contrib-jshint" not found. Is it installed?
    >> Local Npm module "grunt-contrib-uglify" not found. Is it installed?
    >> Local Npm module "grunt-contrib-watch" not found. Is it installed?
    >> Local Npm module "grunt-filerev" not found. Is it installed?
    >> Local Npm module "grunt-google-cdn" not found. Is it installed?
    >> Local Npm module "grunt-karma" not found. Is it installed?
    >> Local Npm module "grunt-newer" not found. Is it installed?
    >> Local Npm module "grunt-ng-annotate" not found. Is it installed?
    >> Local Npm module "grunt-svgmin" not found. Is it installed?
    >> Local Npm module "grunt-usemin" not found. Is it installed?
    >> Local Npm module "grunt-wiredep" not found. Is it installed?
    Loading "Gruntfile.js" tasks...ERROR
    >> Error: Cannot find module 'time-grunt'
安装Bower软件包

cd to_root_project_path

npm install

最后,运行grunt-tast

有时sudo和npm-install-grunt也会解决这个问题


sudo npm install grunt

似乎
grunt
正在尝试加载
time grunt
,但在节点模块中找不到该包。您可以做两件事:(1)如果您有一个package.json文件,它可能指定了许多依赖项,因此只需在同一目录中运行
npm install
,即可将这些依赖项下载到您的node_modules目录中;(2) 要安装单个模块,例如
time-grunt
,您可以执行
npm-install-time-grunt-save-dev
。grunfile.js中有什么内容?在中更新了my-grunfile.jsquestion@HunanRostomyan我更新了脚本以执行nam安装时grunt,现在它正在抱怨>错误:找不到模块“jshint”。由于没有加载nam模块,它是否必须对路径进行任何处理。我不确定路径是否设置正确?@upagna注意到行
require('load-grunt-tasks')(grunt)。这样做的目的是在package.json中查找已声明的依赖项。如果不执行npm安装,这些依赖项可能会丢失,因此grunt将无法找到它们。首先,缺少的是
timegrunt
插件,现在是
jshint
。您只需要通过运行
npm install
来安装所有依赖项。这可能会解决问题,也可能不会,但这并不能真正帮助询问者了解正在发生的事情或如何调试,而这正是当前的问题。
bower install