安装 React 时出错 [英] Error Installing React

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

问题描述

每当我执行 npm init 然后 npm install react - 我得到这个错误

Whenever I do a npm init then npm install react - I get this error

── UNMET PEER DEPENDENCY react@15.3.0

── UNMET PEER DEPENDENCY react@15.3.0

npm WARN baobab-react@0.1.1 需要 react@>=0.13.0 <1.0.0 的对等节点,但没有安装.
npm WARN 固定数据表@0.4.7 需要一个react@>=0.13.0 <0.15.0 ||^0.14.0-beta3 但没有已安装.
npm WARN react-native@0.30.0 需要一个 peerreact@~15.2.0 但没有安装.
npm 警告 react-router@0.13.5需要 react@0.13.x||0.14.x 的同级,但没有安装.新产品经理呃!代码 1

npm WARN baobab-react@0.1.1 requires a peer of react@>=0.13.0 <1.0.0 but none was installed.
npm WARN fixed-data-table@0.4.7 requires a peer of react@>=0.13.0 <0.15.0 || ^0.14.0-beta3 but none was installed.
npm WARN react-native@0.30.0 requires a peer of react@~15.2.0 but none was installed.
npm WARN react-router@0.13.5 requires a peer of react@0.13.x||0.14.x but none was installed. npm ERR! code 1

这是我的 node v6.3.0 和 npm 3.10.3 版本.

This is my node v6.3.0 annd npm 3.10.3 versions.

推荐答案

在你的项目目录下,能否请先运行以下命令:-

Inside your project directory, can you please first run the following commands:-

1) rm -rf node_modules
2) Try installig react again now and other packages which are in your package.json file.

这篇关于安装 React 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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