这里需要什么? 我尝试安装所有引用资料:
>npm install
[email protected] C:...\BowerAndGrunt `-- UNMET PEER DEPENDENCY [email protected]
npm WARN [email protected] requires a peer of grunt@~0.4.1 but none was installed. npm WARN [email protected] No repository field. npm ERR! code 1
包.json:
{
"name": "hertz",
"version": "1.0.0",
"description": "desc",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "legends",
"license": "MIT",
"dependencies": {
"grunt": "^1.0.1"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-csslint": "1.0.0",
"grunt-contrib-cssmin": "1.0.2",
"grunt-contrib-jshint": "1.0.0",
"grunt-contrib-sass": "1.0.0",
"grunt-contrib-uglify": "2.0.0",
"grunt-contrib-watch": "1.0.0",
"grunt-htmlhint": "0.9.13",
"jshint-stylish": "^2.2.1",
"matchdep": "1.0.1"
}
}
最佳答案
做
npm install --save-dev grunt
这是因为 grunt-cssc 需要安装 grunt,但你没有在 pacakge json 中定义它。 了解有关对等依赖关系的更多信息
https://nodejs.org/en/blog/npm/peer-dependencies/
编辑:
因为它要求的 grunt 小于您所拥有的版本 1。在以下链接中检查 npm 中的 semver:
github.com/npm/node-semver#tilde-ranges-123-12-1
基本上,这意味着您的 CSSC 库需要 grunt 0.4 而不是 grunt 1,但希望它也可以与 grunt 1 一起使用。
您可以联系lib作者并要求他升级以支持grunt 1。
关于node.js - 警告 grunt-cssc@0.2.6 需要 grunt@~0.4.1 的同级,但没有安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39317145/