首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >升级反应-引导从0.31.0到0.32.4 (未满足的对等依赖)

升级反应-引导从0.31.0到0.32.4 (未满足的对等依赖)
EN

Stack Overflow用户
提问于 2019-08-23 09:54:50
回答 1查看 550关注 0票数 0

我试图将我的react-bootstrap版本从0.31.0升级到0.32.4。

我得到了一个UNMET PEER DEPENDENCY react@15.4.0

但是看看我的package.json,我的文件中确实有react": "^15.4.0!

那麽,原因何在呢?

下面是我的package.json文件内容。

代码语言:javascript
复制
{
  "private": true,
  "scripts": {
    "transport": "watchify js/app.js -v -t babelify -p livereactload -o public/js/bundle.js"
  },
  "devDependencies": {
    "babel-plugin-react-transform": "^2.0.2",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "bootstrap-sass": "^3.3.7",
    "browserify": "^14.3.0",
    "cross-env": "^3.2.3",
    "del": "^2.2.2",
    "fakerator": "^0.3.0",
    "gulp": "^3.9.1",
    "gulp-concat": "^2.6.1",
    "gulp-less": "^3.3.0",
    "gulp-livereload": "^3.8.1",
    "gulp-uglify": "^3.0.0",
    "gulp-zip": "^4.0.0",
    "laravel-elixir": "^5.0.0",
    "laravel-mix": "0.*",
    "livereactload": "^3.3.0",
    "lodash": "^4.17.4",
    "react-proxy": "^1.1.8",
    "redux-devtools-extension": "^2.13.8",
    "vinyl-buffer": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "vue": "^2.1.10",
    "watchify": "^3.9.0"
  },
  "dependencies": {
    "axios": "^0.15.3",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babelify": "^7.3.0",
    "create-react-class": "^15.6.0",
    "fixed-data-table-2": "^0.7.17",
    "jquery": "^3.2.1",
    "moment": "^2.18.1",
    "node-sass": "^4.5.3",
    "prop-types": "^15.5.10",
    "ramda": "^0.23.0",
    "react": "^15.4.0",
    "react-bootstrap": "^0.31.0",
    "react-bootstrap-datetimepicker": "0.0.22",
    "react-dom": "^15.4.0",
    "react-google-charts": "^1.5.5",
    "react-redux": "^4.3.0",
    "react-router": "^4.1.1",
    "react-router-dom": "^4.2.2",
    "react-sortable-hoc": "^0.6.8",
    "react-widgets": "^3.4.8",
    "redux": "^3.7.2",
    "redux-form": "^6.8.0",
    "redux-promise": "^0.5.3",
    "redux-thunk": "^2.2.0"
  },
  "browserify": {
    "transform": [
      [
        "babelify"
      ]
    ]
  }
}

下面是命令的全部信息:

代码语言:javascript
复制
openssl config failed: error:02001003:system library:fopen:No such process
openssl config failed: error:02001003:system library:fopen:No such process
npm WARN checkPermissions Missing write access to E:\MelaSolutions\WEB\Chronic\node_modules\react-widgets\node_modules\dom-helpers
npm WARN checkPermissions Missing write access to E:\MelaSolutions\WEB\Chronic\node_modules\react-widgets\node_modules\warning
npm WARN checkPermissions Missing write access to E:\MelaSolutions\WEB\Chronic\node_modules\react-widgets\node_modules
E:\MelaSolutions\WEB\Chronic
+-- UNMET PEER DEPENDENCY react@15.4.0
`-- react-bootstrap@0.32.4
  +-- @babel/runtime-corejs2@7.5.5
  | +-- core-js@2.6.9
  | `-- regenerator-runtime@0.13.3
  +-- dom-helpers@3.4.0
  | `-- @babel/runtime@7.5.5
  |   `-- regenerator-runtime@0.13.3
  +-- invariant@2.2.4
  +-- keycode@2.2.0
  +-- prop-types@15.7.2
  | `-- loose-envify@1.4.0
  +-- prop-types-extra@1.1.0
  | `-- react-is@16.9.0
  +-- react-overlays@0.8.3
  +-- react-transition-group@2.9.0
  | +-- loose-envify@1.4.0
  | +-- prop-types@15.7.2
  | `-- react-lifecycles-compat@3.0.4
  `-- uncontrollable@5.1.0

> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0
> (node_modules\chokidar\node_modules\fsevents): npm WARN notsup
> SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9:
> wanted {"os":"darwin","arch":"any"} (current:
> {"os":"win32","arch":"x64"}) npm WARN react-redux@4.3.0 requires a
> peer of react@^0.14.0 but none was installed. npm ERR! Windows_NT
> 10.0.18362 npm ERR! argv "H:\\Program Files\\nodejs\\node.exe" "H:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
> "install" "--save" "react-bootstrap@0.32.4" npm ERR! node v6.11.0 npm
> ERR! npm  v3.10.10 npm ERR! path
> E:\MelaSolutions\WEB\Chronic\node_modules\react-widgets\node_modules\dom-helpers
> npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall access
> 
> npm ERR! enoent ENOENT: no such file or directory, access
> 'E:\MelaSolutions\WEB\Chronic\node_modules\react-widgets\node_modules\dom-helpers'
> npm ERR! enoent ENOENT: no such file or directory, access
> 'E:\MelaSolutions\WEB\Chronic\node_modules\react-widgets\node_modules\dom-helpers'
> npm ERR! enoent This is most likely not a problem with npm itself npm
> ERR! enoent and is related to npm not being able to find a file. npm
> ERR! enoent
> 
> npm ERR! Please include the following file with any support request:
> npm ERR!     E:\MelaSolutions\WEB\Chronic\npm-debug.log
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-09-04 10:09:42

您面临的主要问题是没有write权限的node_modules,而不是作为对等依赖的react版本。

为了解决这个问题,有几种解决办法:

通用解决方案(适用于所有操作系统):

  1. 删除node_modules文件夹
  2. 重新安装依赖项(npm install,最好是yarn)

如果出于任何原因,您仍然有问题(值得删除node_modulespackage-lock.jsonyarn.lock,然后重新安装软件包)

UNIX:在终端中运行此命令:

代码语言:javascript
复制
sudo chown -R someuser:somegroup /path/to/your/project/node_modules
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57623853

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档