3
我開始探索Grunt。閱讀幾個網站,我看到了一些例子。好吧,我創建的package.json和Gruntfile.js:發出命令時出錯Grunt
的package.json http://pastebin.com/Kkt8fuXJ
Gruntfile.j http://pastebin.com/LnSmTzXZ
我的項目的文件夾的組織:
root (index.html)
-src (where is package.json and Gruntfile.js)
-lib
--css
---min
--js
--img
當我給的指揮咕嚕聲總是發生這樣的錯誤:
Loading "Gruntfile.js" tasks...ERROR
>> Error: Unable to parse "package.json" file (Unexpected token }).
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
如果我刪除PKG:grunt.file.readJSON( '的package.json'),:
grunt.loadNpmTasks('grunt-contrib-imagemin');
^^^^^
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected identifier
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
有什麼不對?
謝謝
忘記逗號是一個錯誤。 感謝您的幫助。我改變的package.json和Gruntfile.js但我仍然得到一個錯誤: 'C:\用戶\費利佩\桌面\測試的\ src \ Gruntfile.js:27 ); ^ 加載 「Gruntfile.js」 任務...錯誤 >>語法錯誤:意外的令牌) 警告:任務 「cssmin」 找不到。使用--force繼續。 因警告而中止。「 – user1914644
是的,解決方案它不適合我,我的Json文件做得很好 – Xvegas