Не удается обновить до последней версии React-Bootstrap - PullRequest
0 голосов
/ 12 сентября 2018

У меня проблема с обновлением до последней версииact-bootstrap, когда я делаю

npm install --save react-bootstrap

Он печатает:

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN eslint-config-react-app@0.2.1 requires a peer of babel-eslint@6.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@0.2.1 requires a peer of eslint@3.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@0.2.1 requires a peer of eslint-plugin flowtype@2.18.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@0.2.1 requires a peer of eslint-plugin-import@1.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@0.2.1 requires a peer of eslint-plugin-jsx-a11y@2.2.2 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@0.2.1 requires a peer of eslint-plugin-react@6.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-addons-test-utils@15.6.2 requires a peer of react-dom@^15.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN react-bootstrap-typeahead@1.4.2 requires a peer of react@^0.14.0 || ^15.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-bootstrap-typeahead@1.4.2 requires a peer of react-dom@^0.14.0 || ^15.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-dev-utils@0.2.1 requires a peer of webpack@^1.13.2 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.14 (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ react-bootstrap@0.30.10
updated 1 package and audited 29067 packages in 20.627s
found 275 vulnerabilities (163 low, 77 moderate, 33 high, 2 critical) run `npm audit fix` to fix them, or `npm audit` for details

Таким образом, вместо обновления до версии 0.32.4, остается с 0.30.10

Что мне делать, чтобы это исправить? Мой тест (с Jest) не пройден, и причина может быть в том, что не все зависимости обновлены до последней версии. В обновлениях столько, сколько я мог, но теперь я должен обновить реакцию-начальной загрузки.

package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-jest": "^23.6.0",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "enzyme": "^3.6.0",
    "jest": "^23.6.0",
    "react-addons-test-utils": "^15.6.2",
    "react-dom": "^16.5.0",
    "react-scripts": "^0.6.1",
    "react-test-renderer": "^16.5.0"
  },
  "dependencies": {
    "adal-angular": "^1.0.17",
    "axios": "^0.15.3",
    "bootstrap": "^3.3.7",
    "jquery": "^3.3.1",
    "lodash": "^4.17.10",
    "prop-types": "^15.6.2",
    "react": "^16.5.0",
    "react-bootstrap": "^0.30.10",
    "react-bootstrap-typeahead": "^1.4.2",
    "react-http-request": "^1.0.4",
    "react-overlays": "^0.8.3",
    "react-router-dom": "^4.3.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "jest",
    "eject": "react-scripts eject"
  },
  "description": "This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).",
  "main": "index.js",
  "author": "",
  "license": "ISC",
  "jest": {
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
      "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
    }
  }
}

Ответы [ 3 ]

0 голосов
/ 12 сентября 2018

Попробуйте

npm install --save react-bootstrap@0.32.4

или

yarn add react-bootstrap@0.32.4
0 голосов
/ 12 сентября 2018

Причина исходит из файла package.json, особенно из каретки.Например:

^0.2.3 means 0.2.3 <= v < 0.3.

Итак, в вашем случае:

^0.30.10 means 0.30.10 <= v < 0.31

Чтобы перейти на последний пакет, удалите строку из вашей зависимости и повторите команду (npm install --save react-bootstrap)

0 голосов
/ 12 сентября 2018

Даже вы можете обновить любой пакет до последней версии, используя latest вместо указания любой версии.

npm install --save react-bootstrap@latest
...