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