我正在尝试在一个托管在JavaScript上的GitHub项目上设置Travis,但我得到的错误如下
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module 'jshint/src/cli/cli'这些是我的档案:
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
myFiles: ['cyrlatconverter-v0.5.4.js']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
};.travis.yml
language: node_js
node_js:
- 0.10package.json
{
"name": "node-travis",
"version": "0.1.0",
"devDependencies": {
"grunt": "0.4.1",
"grunt-cli": "0.1.9",
"grunt-contrib-jshint": "0.6.0"
},
"scripts": {
"test": "grunt --verbose"
}
}发布于 2014-03-31 10:51:56
正如github.com/gruntjs/grunt-contrib-jshint/issues/92中所讨论的,升级版本解决了这个问题。
同样,正如@Dexa所指出的,对于他来说--移除scripts of package.json的一部分是有效的,并在Gruntfile.js中添加了以下内容:
grunt.registerTask('default', ['jshint']);
为了澄清起见,上面的^将默认的grunt任务注册为在将grunt写入命令行时运行jshint。
https://stackoverflow.com/questions/22720907
复制相似问题