我有我的項目文件在目錄/myproject
。我想Grunt
建立文件到/myproject/www
。這裏是我做了什麼:grunt - 什麼是正確的安裝過程?
1)打開命令行/myproject
,並運行以下命令:npm install -g grunt-cli
2)/myproject
打開命令行運行以下命令:npm install grunt --save-dev
。該命令下載了一堆文件並在/myproject
內創建了文件夾node_modules
。這裏是node_modules
的結構:/myproject/node_modules/grunt/package.json
。
如果我在/myproject/node_modules/grunt/
文件夾內創建文件Gruntfile.js
並從該文件夾運行任務,一切都OK。但我想運行/myproject
文件夾中的任務。所以我將Gruntfile.js和package.json文件從/myproject/node_modules/grunt/
上移到/myproject
。但是,現在我運行Grunt
時出現以下錯誤:>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
那麼,我做錯了什麼?