解決安裝grunt時internal/modules/cjs/loader.js:797報錯


1、ES安裝head離線啟動grunt時,報錯找不到包

[root@corre home]# grunt -version
internal/modules/cjs/loader.js:797
throw err;
^

Error: Cannot find module 'grunt-cli/bin/grunt'
Require stack:

 

2.實際是我們通過npm安裝時候,在 node_modules下生成的包的文件名字是grunt

[root@corre node_modules]# ls
cnpm grunt npm

 

3.只需把文件名字改為grunt-cli

[root@corre node_modules]# mv grunt/ grunt-cli

 

4.最后驗證

[root@corre home]# grunt -version
grunt-cli v1.2.0
grunt v1.0.4


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM