无法为反应版本v0.13.x安装react-dom

时间:2018-01-03 06:40:38

标签: node.js reactjs react-dom

我在尝试运行命令npm install react react-dom

时遇到以下错误
    npm install react react-dom
    - base62@1.2.0 node_modules/base62
    - esprima-fb@15001.1.0-dev-harmony-fb node_modules/jstransform/node_modules/esprima-fb
    - object-assign@2.1.1 node_modules/jstransform/node_modules/object-assign
    - source-map@0.4.4 node_modules/jstransform/node_modules/source-map
    - jstransform@11.0.3 node_modules/jstransform
    - envify@3.4.1 node_modules/envify
    /prd/dir/UI
    ├─┬ UNMET PEER DEPENDENCY react@16.2.0
    │ └── fbjs@0.8.16 
    └─┬ UNMET PEER DEPENDENCY react-dom@16.2.0
      └── fbjs@0.8.16 

    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.3
    npm WARN enoent ENOENT: no such file or directory, open         '/prd/dir/UI/package.json'
    npm WARN react-simple-dropdown@3.2.0 requires a peer of react@0.14.x || 15.x but none was installed.
    npm WARN react-simple-dropdown@3.2.0 requires a peer of react-dom@0.14.x || 15.x but none was installed.
    npm WARN reflux@0.2.13 requires a peer of react@>=0.12.2 <0.15.0 but none was installed.
    npm WARN UI No description
    npm WARN UI No repository field.
    npm WARN UI No README data
    npm WARN UI No license field.
    npm ERR! code 1

关注我的开发依赖项:

     "devDependencies": {
        "babel-core": "^5.8.25",
        "babelify": "^6.1.x",
        "browser-sync": "^2.7.13",
        "browserify": "^10.2.6",
        "debowerify": "^1.3.1",
        "del": "^1.2.0",
        "eslint-plugin-react": "^3.6.3",
        "gulp": "^3.9.0",
        "gulp-autoprefixer": "^2.3.1",
        "gulp-if": "^1.2.5",
        "gulp-imagemin": "^2.3.0",
        "gulp-notify": "^2.2.0",
        "gulp-rename": "^1.2.2",
        "gulp-sass": "^2.0.x",
        "gulp-sourcemaps": "^1.5.2",
        "gulp-streamify": "0.0.5",
        "gulp-uglify": "^1.2.0",
        "gulp-util": "^3.0.6",
        "history": "^1.12.5",
        "humps": "^0.6.0",
        "lodash": "^3.10.0",
        "react": "^0.13.x",
        "react-document-title": "^1.0.2",
        "react-router": "^1.0.0-rc1",
        "reflux": "^0.2.9",
        "run-sequence": "^1.1.1",
        "superagent": "^1.2.0",
        "vinyl-source-stream": "^1.1.0",
        "watchify": "^3.2.x"
      }

1 个答案:

答案 0 :(得分:1)

为了安装特定版本的npm软件包,你可以在最后提到版本,如

npm install -S react@0.13.x

但是,我强烈建议您使用最新版本。此外,React-DOM仅作为单独的包从版本0.14.0创建,因此在此之前不需要。请检查此回答react vs react DOM confusion