grunt錯誤——Fatal error: Unable to find Gruntfile,gruntgruntfile

來源:互聯網
上載者:User

grunt錯誤——Fatal error: Unable to find Gruntfile,gruntgruntfile

E:\website\jquery-plugins>gruntA valid Gruntfile could not be found. Please see the getting started guide formore information on how to configure grunt: http://gruntjs.com/getting-startedFatal error: Unable to find Gruntfile.

錯誤提示Gruntfile.js檔案找不到,但項目中已經有Gruntfile.js檔案,後來發現是用npm安裝grunt模組時,沒有安裝完整(可能是中途中斷了安裝,但grunt模組的目錄已經存在與node_modules目錄下),解決辦法是重新安裝grunt模組:

E:\website\jquery-plugins>npm install grunt

再次執行:

E:\website\jquery-plugins> gruntLoading "uglify.js" tasks...ERROR>> Error: ENOENT, no such file or directory 'E:\website\jquery-plugins\node_modules\grunt-contrib-uglify\node_modules\uglify-js\lib\utils.src'Warning: Task "uglify" not found. Use --force to continue.Aborted due to warnings.

錯誤提示沒有這個檔案或者目錄,猜測gruntuglify外掛程式也沒有安裝完整,重新安裝:

E:\website\jquery-plugins>npm install grunt-contrib-uglify --save-dev

執行grunt的預設tasks(我這裡的預設tasks只有uglify

E:\website\jquery-plugins>gruntRunning "uglify:build" (uglify) task>> 1 file created.Done, without errors.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.