javascript - React 安装相关问题,请教一下大家:

查看:229
本文介绍了javascript - React 安装相关问题,请教一下大家:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

我从如下地址上面以 zip 形式下载了一份 v15.3.1 的react代码。

https://github.com/facebook/react/tree/v15.3.1

解压缩后,打开目录,进入目录中,使用

npm install 

来安装包所依赖的控件,但是他报了如下错误:

> react-build@15.3.1 postinstall C:\Users\chenglin.song\Desktop\UAT\个人学习\React\react-15.3.1
> node node_modules/fbjs-scripts/node/check-dev-engines.js package.json


assert.js:85
  throw new assert.AssertionError({
  ^
AssertionError: Current npm version is not supported for development, expected "4.1.1" to satisfy "2.x || 3.x".
    at C:\Users\chenglin.song\Desktop\UAT\个人学习\React\react-15.3.1\node_modules\fbjs-scripts\node\check-dev-engines.js:57:5
    at ChildProcess.exithandler (child_process.js:197:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.14 (node_modules\babel-cli\node_modules\chokidar\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.0.14 (node_modules\fbjs-scripts\node_modules\babel\node_modules\chokidar\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 ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\chenglin.song\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.9.4
npm ERR! npm  v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! react-build@15.3.1 postinstall: `node node_modules/fbjs-scripts/node/check-dev-engines.js package.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-build@15.3.1 postinstall script 'node node_modules/fbjs-scripts/node/check-dev-engines.js package.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-build package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/fbjs-scripts/node/check-dev-engines.js package.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-build
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-build
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\chenglin.song\Desktop\UAT\个人学习\React\react-15.3.1\npm-debug.log

截图如下:

我简单看了一下错误描述,然后查看了一下自己的npm 版本:

无法理解到底为什么错了,还是说就不可以这么安装?

解决方案

报错信息:

Current npm version is not supported for development, expected "4.1.1" to satisfy "2.x || 3.x".

npm版本不符合,把你的npm降到3试试。

这篇关于javascript - React 安装相关问题,请教一下大家:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆