我已经从official website下载了 bootstrap 源文件,在使用node的npm安装项目时,我遇到了依赖冲突.我的机器上安装了grunt 0.4.3,但一些 bootstrap 依赖项需要0.4.00.4.1.

npm install -g grunt-cli命令执行时没有任何问题.下面是我在执行npm install命令后得到的日志(log):

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软件包中的第30行.json文件:从"~0.4.2"到"0.4.2":

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

这意味着0.4.3不再符合依赖项规范,但也意味着以后不会安装新版本的grunt.这足以让事情运转起来,但最终你可能应该把它改回来(也许在你的下一个 bootstrap 项目中别管它).

Node.js相关问答推荐

MongoDB的方面查询的Postgres类似功能

合并Shift对象数组以创建最终的排班表

TypeScript Eslint警告了一个AWS客户端构造函数(dynamodb),但没有警告另一个(s3)

Cypress.io - 如何等待返回调用属性的方法的结果?

有没有办法判断 UUID 是否是使用 node.js 中的特定命名空间生成的?

如何修改这个flake.nix,这样我就不用每次加载环境都加载nix包了

从 Response.json() 返回的 JSON 似乎无效?

级联定时器和Jest 的异步功能

处理 UTC 日期和future

如何使用填充在mongoose 上保存新数据

discordjs如何添加所有意图/权限

Web3.js 脚本在监听 CreatedPairs 时退出

使用 grunt 服务器,如何将所有请求重定向到根 url?

如何使用 superagent/supertest 链接 http 调用?

Mongoose:查找、修改、保存

已安装全局 NPM 包但未找到命令

TypeError:请求路径包含未转义的字符,我该如何解决这个问题

安装 node 包时可以使用自定义目录名称而不是node_modules吗?

在 Node.js 中获取终端的宽度

用于轻松部署和更新的 Node.js 设置