np-6ren">
gpt4 book ai didi

npm - "npm install"给出错误消息 "invalid",这是什么?

转载 作者:行者123 更新时间:2023-12-04 15:19:03 25 4
gpt4 key购买 nike

enter image description here

请检查图片。

我猜它与 package.json 有关但我不太确定。

回复评论获取更多信息

最初我正在安装 material-ui .

详细消息在这里:

I:\react-boilerplate>npm install material-ui

react-boilerplate@3.4.0 I:\react-boilerplate

+-- material-ui@0.17.1

| +-- keycode@2.1.8

| +-- lodash.throttle@4.1.1

| +-- UNMET PEER DEPENDENCY react@^15.4.2

| +-- react-addons-create-fragment@15.4.2

| +-- react-addons-transition-group@15.4.2

| +-- react-event-listener@0.4.3

| | +-- UNMET PEER DEPENDENCY react@^15.4.2

| | `-- react-addons-shallow-compare@15.4.2

| +-- recompose@0.22.0

| | `-- change-emitter@0.1.3

| `-- simple-assign@0.1.0

+-- UNMET PEER DEPENDENCY react-tap-event-plugin@^2.0.1

`-- UNMET PEER DEPENDENCY webpack@2.2.0-rc.3



然后我试图通过 npm install 修复 UNMET PEER DEPENDENCY他们。

第一次尝试给出了这个:

react-boilerplate@3.4.0 I:\react-boilerplate

+-- react@15.4.2 invalid

+-- react-tap-event-plugin@2.0.1

`-- UNMET PEER DEPENDENCY webpack@2.2.0-rc.3

`-- webpack-sources@0.1.5



如您所见,这是第一个 invalid我遇见了。

所以我只是想弄清楚为什么会这样 invalid弹出以及如何修复它。

回复评论获取更多信息

这是 package.json,依赖项部分

"dependencies": { "babel-polyfill": "6.20.0", "chalk": "1.1.3", "compression": "1.6.2", "cross-env": "3.1.3", "express": "4.14.0", "fontfaceobserver": "2.0.7", "immutable": "3.8.1", "intl": "1.2.5", "invariant": "2.2.2", "ip": "1.1.4", "lodash": "4.17.2", "minimist": "1.2.0", "react": "15.4.1", "react-dom": "15.4.1", "react-helmet": "3.2.2", "react-intl": "2.1.5", "react-redux": "4.4.6", "react-router": "3.0.0", "react-router-redux": "4.0.6", "react-router-scroll": "0.4.1", "redux": "3.6.0", "redux-immutable": "3.0.8", "redux-saga": "0.14.0", "reselect": "2.5.4", "sanitize.css": "4.1.0", "styled-components": "1.1.2", "warning": "3.0.0", "whatwg-fetch": "2.0.1" },



和 devDependencies 部分

"devDependencies": { "babel-cli": "6.18.0", "babel-core": "6.21.0", "babel-eslint": "7.1.1", "babel-loader": "6.2.10", "babel-plugin-dynamic-import-node": "1.0.0", "babel-plugin-react-intl": "2.2.0", "babel-plugin-react-transform": "2.0.2", "babel-plugin-transform-es2015-modules-commonjs": "6.18.0", "babel-plugin-transform-react-constant-elements": "6.9.1", "babel-plugin-transform-react-inline-elements": "6.8.0", "babel-plugin-transform-react-remove-prop-types": "0.2.11", "babel-preset-latest": "6.16.0", "babel-preset-react": "6.16.0", "babel-preset-react-hmre": "1.1.1", "babel-preset-stage-0": "6.16.0", "cheerio": "0.22.0", "circular-dependency-plugin": "2.0.0", "coveralls": "2.11.15", "css-loader": "0.26.1", "enzyme": "2.6.0", "eslint": "3.11.1", "eslint-config-airbnb": "13.0.0", "eslint-config-airbnb-base": "10.0.1", "eslint-import-resolver-webpack": "0.8.0", "eslint-plugin-import": "2.2.0", "eslint-plugin-jsx-a11y": "2.2.3", "eslint-plugin-react": "6.7.1", "eslint-plugin-redux-saga": "0.1.5", "eventsource-polyfill": "0.9.6", "exports-loader": "0.6.3", "file-loader": "0.9.0", "html-loader": "0.4.4", "html-webpack-plugin": "2.24.1", "image-webpack-loader": "2.0.0", "imports-loader": "0.6.5", "jest-cli": "18.0.0", "lint-staged": "3.2.1", "ngrok": "2.2.4", "node-plop": "0.5.4", "null-loader": "0.1.1", "offline-plugin": "4.5.2", "plop": "1.7.3", "pre-commit": "1.1.3", "react-addons-test-utils": "15.4.1", "rimraf": "2.5.4", "shelljs": "0.7.5", "sinon": "2.0.0-pre", "style-loader": "0.13.1", "url-loader": "0.5.7", "webpack": "2.2.0-rc.3", "webpack-dev-middleware": "1.9.0", "webpack-hot-middleware": "2.15.0" }

最佳答案

此处的无效依赖项表明安装了不适当版本的依赖项包。在这种情况下,您的项目正在请求 webpack@2.2.0-rc3 , 但版本 2.2.1而是安装了。请注意,版本范围内没有插入符号 (^) 或波浪号 (~),这意味着 2.2.1不是有效匹配。

React 发生了另一个冲突,它在版本 15.4.1 中已修复。并且应该升级到版本范围^15.4.2 ,根据其他依赖项(例如 material-ui )的要求。

为了设置新版本的依赖项(升级/降级),不要忘记各自的保存标志( --save/-S--save-dev/-D )。

npm install -S react@^15.4.2

不幸的是, react-tap-event-plugin取决于版本 2.2.0-rc3 webpack,所以你不应该升级 webpack。相反,您可以调用 npm update --dev 确保所有注册的依赖项都安装了正确的版本。如果一切都失败了,一个天真的但有效的技巧是删除 node_modules 文件夹并从头开始安装所有包。

关于npm - "npm install"给出错误消息 "invalid",这是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43249820/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com