【发布时间】:2016-03-02 08:44:26
【问题描述】:
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
【问题讨论】:
-
似乎
grunt正在尝试加载time-grunt,但是在node_modules 中找不到该包。您可以做两件事:(1)如果您有一个 package.json 文件,它可能指定了许多依赖项,因此只需在同一目录中运行npm install即可将这些依赖项下载到您的node_modules 目录; (2)安装个别模块,如time-grunt,可以做npm install time-grunt --save-dev。 -
你的 Gruntfile.js 中有什么?
-
更新了我有问题的 Gruntfile.js
-
@HunanRostomyan 我更新了脚本来执行 nam install time-grunt,现在它在抱怨 > 错误:找不到模块 'jshint-stylish'。它是否必须对路径做任何事情,因为没有加载任何 nam 模块。不知道路径是否设置正确?
-
@upagna 注意
require('load-grunt-tasks')(grunt);这一行。这样做是在 package.json 中查找声明的依赖项。如果你不做npm install,那些依赖可能会丢失,所以 grunt 将无法找到它们。首先,丢失的是time-grunt插件,现在是jshint-stylish。您只需要通过运行npm install来安装所有依赖项。
标签: javascript node.js amazon-ec2 gruntjs npm