私は現在Steve Footeでプログラムを学びます。私はオペレーティングシステムとしてubuntuを使用しています。私はNode.jsをインストールし、gruntコマンドラインをインストールし、npmを正しいフォルダにインストールしました。 私は、指定したフォルダ上でノードを実行したとき、私が持っている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
コマンドノードを入力すると、プロンプトが表示されます。私はjavafilesを実行する必要があります。プロンプトにprompt.jsと入力すると、エラーとして表示されます: 'ReferenceError:プロンプトが定義されていません' – Mo920192