2016-04-09 78 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