node.js - Bootstrap 中的 Grunt 依赖冲突

标签 node.js twitter-bootstrap gruntjs npm

我已经从 official website 下载了 Bootstrap 源文件。在使用 Node 的 npm 安装项目时,我遇到了依赖冲突。我的机器上安装了 grunt 0.4.3,但一些 Bootstrap 依赖项需要 0.4.0 和一些 0.4.1

npm install -g grunt-cli 命令执行没有任何问题。这是我在执行 npm install 命令后得到的日志:

npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-banner@0.2.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-contrib-clean@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-concat@0.3.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-connect@0.6.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-copy@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-csslint@0.2.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-cssmin@0.7.0 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-contrib-jade@0.9.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-contrib-jshint@0.8.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-less@0.9.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-qunit@0.4.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-uglify@0.3.3 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-watch@0.5.3 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-csscomb@2.0.1 wants grunt@~0.4.2
npm ERR! peerinvalid Peer grunt-exec@0.4.3 wants grunt@~0.4
npm ERR! peerinvalid Peer grunt-html-validation@0.1.13 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-jekyll@0.4.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-jscs-checker@0.3.2 wants grunt@0.4.2
npm ERR! peerinvalid Peer grunt-saucelabs@5.0.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-sed@0.1.1 wants grunt@~0.4

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\\Desktop\bootstrap-3.1.1
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\\Desktop\bootstrap-3.1.1\npm-debug.log
npm ERR! not ok code 0

我正在关注 these安装步骤。

我如何干净地安装这个项目,没有任何错误?

最佳答案

我今天早上也遇到了这个问题。我最终更改了 Bootstrap 的 package.json 文件中的第 30 行:从“~0.4.2”到“0.4.2”:

27  "devDependencies": {
...
30    "grunt" : "0.4.2"

这意味着 0.4.3 不再符合依赖规范,但这也意味着您以后不会安装新版本的 grunt。这足以让事情正常运行,但您最终可能应该将其改回(也许在您的下一个 Bootstrap 项目中不要理会它)。

关于node.js - Bootstrap 中的 Grunt 依赖冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22269101/

相关文章:

node.js - Grunt SASS contrib 不会在目标目录中生成 css 文件

javascript - node.js,express,如何从post请求中的body表单数据中获取数据

node.js - Node.js 的按键因数字而崩溃

html - 无法删除边框轮廓

cordova - 使用 LiveReload 在模拟器浏览器中测试 PhoneGap 应用

javascript - 将 js 文件替换为相应的缩小版本

javascript - insertMany 不是函数

javascript - 如何在 Nodejs 中循环调用异步函数

html - Bootstrap 导航栏不适用于移动设备

python - Bootstrap 模态不更新模态内容