2016-04-09 124 views
0

我試圖安裝問題而安裝咕嚕臨界CSS

須藤NPM安裝咕嚕臨界CSS --save-dev的

Password:********** 

我一直得到

npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm 
npm WARN [email protected] requires a peer of [email protected]~0.4.2 but none was installed. 

我'已經試過

須藤NPM更新-g NPM

/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js 
/usr/local/lib 
└── [email protected] 

須藤NPM安裝-g咕嚕-CLI

/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt 
/usr/local/lib 
└── [email protected] 

須藤NPM安裝咕嚕臨界CSS --save -dev

npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm 
npm WARN [email protected] requires a peer of [email protected]~0.4.2 but none was installed. 

我在這裏做錯了什麼?有人可以填寫我錯過的內容嗎?


詳細

npm v3.8.7 
grunt-cli v1.2.0 
grunt v1.0.1 

Gruntfile.js

criticalcss: { 
    custom: { 
     options: { 
      url: "http://localhost:8888", 
      width: 1200, 
      height: 900, 
      outputfile: "public/dist/wedding/css/critical.css", 
      filename: "public/dist/wedding/css/all.css", 
      buffer: 800*1024, 
      ignoreConsole: false 
     } 
    } 
}, 

加載

grunt.loadNpmTasks('grunt-critical-css'); 

說它

grunt.registerTask('default', [ 

    'clean:dist', 
    'concat', 
    'uglify', 
    'cssmin', 
    // 'htmlmin', 
    'compress', 
    'criticalcss' 

]); 

RESULT

咕嚕

Warning: Task "criticalcss" not found. Use --force to continue. 
Aborted due to warnings. 

咕嚕--force

Warning: Task "criticalcss" not found. Used --force, continuing. 
Done, but with warnings. 

去檢查一個文件

Nothing generated 

回答

1

此插件需要咕嚕~0.4.2

看起來你沒有安裝正確的咕嚕版本做。 試試這個:

npm update -g npm

sudo npm update -g npm

,之後:

npm install -g grunt-cli

+0

好的,讓我試試看。謝謝。 – ihue

+0

我試着更新npm和grunt,然後再次嘗試安裝,'sudo npm install grunt-critical-css --save-dev'仍然有同樣的錯誤。 'npm WARN棄用[email protected]:這個軟件包已經重新集成到npm中,現在已經過時了npm npm WARN [email protected]需要[email protected]~0.4.2的同行,但沒有一個是已安裝。 – ihue

+0

@ihue什麼是你當前版本的nodeJS,npm,grunt?看起來像所有安裝成功...它只是警告信息 – semanser

3

這些警告信息,通常是你的npm install會成功,即使你繼續有這些消息ES。

這些消息根據安裝的軟件包的所有package.json依賴關係註冊表以及您正在安裝的軟件包的所有分層依賴性生成。

因此,例如要安裝grunt-critical-css包有這個package.jsonhttps://github.com/filamentgroup/grunt-criticalcss/blob/master/package.json其中例如有這樣扶養grunt-cli具有此package.jsonhttps://github.com/gruntjs/grunt-cli/blob/master/package.json ...等等。

在你的情況下,其中一個依賴包,這是[email protected]已折舊。

+0

你如何建議我修復'[email protected]已被折舊錯誤?請提供建議。 – ihue

+0

它是否引起問題,除了只是發出警告 –

+1

當我運行'grunt'時,我得到了這個'grunt 警告:找不到任務「criticalcss」。使用--force繼續。 由於警告而中止。 – ihue