2014-09-03 54 views
3

所有的npm安裝都提供了錯誤和警告,但最後會說「一切正常」。 當我嘗試咕嚕咕嚕時,我收到了這些警告。獲取grunt命令不起作用

>> Local Npm module "grunt-contrib-connect" not found. Is it installed? 
>> Local Npm module "grunt-contrib-watch" not found. Is it installed? 
>> Local Npm module "grunt-contrib-htmlmin" not found. Is it installed? 
>> Local Npm module "grunt-contrib-cssmin" not found. Is it installed? 
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed? 
>> Local Npm module "grunt-bower-requirejs" not found. Is it installed? 
>> Local Npm module "grunt-eslint" not found. Is it installed? 
>> Local Npm module "grunt-jscs" not found. Is it installed? 

我該如何解決?

+0

「所有的NPM將安裝了錯誤的」 - 這有可能會是爲步兵警告的部分原因。 – user123444555621 2014-09-03 03:14:15

回答

5

您正在Mac或Windows上安裝嗎? 首先,確保繁重的客戶端目錄中安裝:

$ npm install -g grunt-cli 

然後:

$ npm install grunt-serve 

安裝更多文檔可以在這裏找到: https://www.npmjs.org/package/grunt-serve

1

嘗試如下:

1) npm install -g grunt-cli 

這會將grunt命令放在系統路徑中,允許它從任何目錄運行。

請注意,安裝grunt-cli不會安裝Grunt任務運行器! Grunt CLI的工作很簡單:運行已安裝在Gruntfile旁邊的Grunt版本。這允許多個版本的Grunt同時安裝在同一臺機器上。

2) npm install grunt --save-dev 

3) npm install grunt-serve 

增加步兵和gruntplugins到現有的package.json最簡單的方法是用命令NPM安裝--save-dev的。這不僅會在本地安裝,而且會自動添加到devDependencies部分,使用波形版本範圍。

尋求進一步的幫助請點擊此鏈接

http://gruntjs.com/getting-started