咕噜声没有定义
Grunt not defined
本文关键字:定义 更新时间:2023-09-26
我是Grunt的新手,一直在努力使这个工作:这是我的Gulpfile.js:
'use strict';
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required Grunt tasks
require('jit-grunt')(grunt);
module.exports = function(grunt) {
// Define the configuration for all the tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Make sure code styles are up to par and there are no obvious mistakes
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: {
src: [
'Gruntfile.js',
'app/scripts/{,*/}*.js'
]
}
}
});
grunt.registerTask('build', [
'jshint'
]);
grunt.registerTask('default', ['build']);
};
This my package.json:
{
"name": "conFusion",
"private": true,
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0",
"jit-grunt": "^0.10.0",
"jshint-stylish": "^2.2.1",
"time-grunt": "^1.4.0"
},
"engines": {
"node": ">=0.10.0"
}
}
这是我得到的错误信息:
伙计们,我需要帮助。我在windows 10上工作,所以我在那里使用命令行。繁重构建
加载"Gruntfile.js"
任务……错误>>参考错误:grunt没有定义
警告:未找到任务"build"。使用——force继续。
由于警告而中止。
module.exports = function(grunt) {
这就是您定义grunt
变量的地方。它是您创建的函数的参数。
但是你试着在这里使用它:
require('time-grunt')(grunt);
:
require('jit-grunt')(grunt);
在函数之外的,其中变量不存在。
将行移到函数中
相关文章:
- 用嵌套函数和默认函数定义函数
- Dojo不解析自定义小部件的模板html中的小部件声明性
- 为什么“;未定义的“;在JavaScript中结束循环
- 要求未定义JS回调参数
- 控制台返回var不是't定义,但它是
- 在自定义mean.io包中使用angular-chart.js作为依赖项
- 如何检查管道中未定义的项目
- TypeError:无法读取属性'推'未定义的JavaScript
- jQuery自定义验证比较多个输入的序列
- 查看JS对象的所有键,甚至是getter定义的键
- fetch() 函数未在 Ubuntu Chromium 浏览器上定义
- $window.ga在AngularJS事件中未定义
- 如何在JQuery函数中定义一个值,然后调用另一个函数并使用该值
- 是否有任何方法可以使用jQuery替换在数组中定义值的文本
- 未捕获的TypeError无法读取未定义的属性socialsharing
- WebDriverException:tinyMCE未在selenium Web driver java中定义
- 从HTTPGET返回一个自定义对象列表,以便在Angular 2应用程序中使用
- 定义完全独立的样式信息
- 如何在选项卡上定义属性'的主窗口对象
- 为什么grunt contrib connect的中间件选项的第三个参数是未定义的