【发布时间】:2016-07-30 18:53:20
【问题描述】:
我正在尝试安装
sudo npm install grunt-critical-css --save-dev
Password:**********
我一直得到
npm WARN deprecated npmconf@2.0.9: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN grunt-penthouse@0.3.0 requires a peer of grunt@~0.4.2 but none was installed.
我试过了
sudo npm update -g npm
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/lib
└── npm@3.8.7
sudo npm install -g grunt-cli
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
/usr/local/lib
└── grunt-cli@1.2.0
sudo npm install grunt-critical-css --save-dev
npm WARN deprecated npmconf@2.0.9: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN grunt-penthouse@0.3.0 requires a peer of grunt@~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'
]);
结果
咕哝
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
【问题讨论】:
-
嗨@cyber8200 你找到解决方案了吗?我面临同样的问题。但是,我没有找到任何解决方案。你能帮帮我吗?