GitHub에서 호스팅되는 하나의 JavaScript 프로젝트에서 Travis CI를 설정하려고하는데 다음과 같은 오류가 발생합니다.
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.10
package.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"
}
}
github.com/gruntjs/grunt-contrib-jshint/issues/92에 설명 된대로 버전을 업그레이드 하면 문제가 해결되었습니다.
또한 @Dexa가 지적했듯이 package.json 의 scripts
일부를 제거 하고 Gruntfile.js에 다음을 추가했습니다 .
grunt.registerTask('default', ['jshint']);
설명을 위해 ^ 위 grunt
는 명령 줄에를 쓸 때 jshint를 실행할 기본 grunt 작업을 등록 합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다