Grunt“Gruntfile.js”任务......错误

时间:2015-11-28 08:43:23

标签: javascript node.js amazon-ec2 gruntjs 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'

NPM grunt 的新用户。不确定到底发生了什么?任何想法如何调试?已安装 NPM BOWER

2 个答案:

答案 0 :(得分:2)

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





安装NPM软件包。




  cd to_root_project_path
 
 npm install
  




安装Bower软件包




  bower安装
  




最后,运行grunt tast




答案 1 :(得分:-1)

有时sudo with npm install grunt也解决了这个问题

sudo npm install grunt