0
我目前正在學習如何使用史蒂夫·富特編程。我使用Ubuntu作爲操作系統。我安裝了Node.js,安裝了grunt命令行,並將npm install安裝到了正確的文件夾中。 我注意到一個問題,當我在指定的文件夾上運行節點時,它不會運行我擁有的js文件。我甚至去了與js文件的文件夾,它沒有工作。然後我嘗試了節點values.js,但沒有出現。輸入cmd grunt jshint時發生錯誤。
這是我對的package.json文件代碼:
{
"name": "kittenbook",
"version": "0.0.1",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-jshint": "~0.6.3"
}
}
這是Gruntfile.js
module.exports = function(grunt) {
//Project Configuiration
grunt.initConfig({
/*
* We will configuire our tasks here
*/
concat: {
release: {
src:['js/values.js', 'js/prompt.js'],
dest: 'release/main.js'
}
},
copy: {
release{
src: 'manifest.json',
dest: 'release/manifest.json'
}
},
jshint: {
files: ['js/values.js', 'js/prompt.js']
}
});
//We will load our plugins here
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
//We will register our tasks here
grunt.registerTask('default', ['jshint', 'concat', 'copy']);
};
如果對不起格式是壞這裏真的是所有列隊文本文件。
當我鍵入咕嚕jshint警告過來說:
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected token {
Warning: Task "jshint" not found. Use --force to continue.
Aborted due to warnings.
你預期會發生什麼?意思是,你期望運行什麼命令,你期望它的輸出是什麼? – stone
當我輸入命令節點時出現提示。但它應該運行我擁有的java文件。當我輸入prompt.js到提示符時,它給了我一個錯誤: 'ReferenceError:prompt is not defined' – Mo920192