通過npm安裝grunt和grunt server,按照網上文檔在lasticsearch-head-master目錄部署
npm install -g grunt
第一個問題是
執行完lasticsearch-head-master目錄下一直沒有node_modules目錄產生。
ls
Dockerfile elasticsearch-head.sublime-project grunt_fileSets.js LICENCE plugin-descriptor.properties README.textile src
Dockerfile-alpine Gruntfile.js index.html package.json proxy _site test
解決:
npm install grunt --save-dev
就在當前目錄創建了node_modules
第二個問題是
執行grunt server有如下提示
Local Npm module “grunt-contrib-clean” not found. Is it installed?
Local Npm module “grunt-contrib-concat” not found. Is it installed?
Local Npm module “grunt-contrib-watch” not found. Is it installed?
Local Npm module “grunt-contrib-connect” not found. Is it installed?
Local Npm module “grunt-contrib-copy” not found. Is it installed?
Local Npm module “grunt-contrib-jasmine” not found. Is it installed?
Warning: Task “connect:server” not found. Use --force to continue.
Aborted due to warnings.
解決方法:
npm install grunt-contrib-clean grunt-contrib-concat grunt-contrib-watch grunt-contrib-connect grunt-contrib-copy grunt-contrib-jasmine
以上兩個問題也有可能是我的安裝方式不對導致的。通過這樣操作最終把問題解決了。