react-native init 指定react版本和react-native版本
react-native init specify react version and react-native version
我基本上想用 react@15.6.0 和 react-native@0.45.0 初始化一个 react-native 项目,因为依赖问题。但是 react-native 命令只允许我指定 react-native 版本:
react-native init sample --version react-native@0.45.0
此命令无效:
react-native init diskful --version react-native@0.45.0 --version react@15.6.0
这也是:
react-native init diskful --version react-native@0.45.0 react@15.6.0
还有这个:
react-native init diskful --version react@15.6.0 react-native@0.45.0
全局安装react@15.6.0或react-native@0.45.0不影响。
请有人帮助我!
创建一个项目:
react-native init MyNewApp --version 0.45.0
如果你想改变版本,那么试试这个:
npm install --save react-native@0.44.0
npm install --save react@16.0.0-alpha.6
- 删除 node_modules 文件夹
编辑 Package.json
"dependencies": {
"react": "15.6.0",
"react-native": "0.45.0",
},
- 运行 命令 'npm install'
您可以使用
启动应用程序
react-native init --version="0.45.0" yourapp,
如果需要进一步更改,请在 package.json
或 react-native 字段中进行更改,然后简单地执行 npm install
我基本上想用 react@15.6.0 和 react-native@0.45.0 初始化一个 react-native 项目,因为依赖问题。但是 react-native 命令只允许我指定 react-native 版本:
react-native init sample --version react-native@0.45.0
此命令无效:
react-native init diskful --version react-native@0.45.0 --version react@15.6.0
这也是:
react-native init diskful --version react-native@0.45.0 react@15.6.0
还有这个:
react-native init diskful --version react@15.6.0 react-native@0.45.0
全局安装react@15.6.0或react-native@0.45.0不影响。 请有人帮助我!
创建一个项目:
react-native init MyNewApp --version 0.45.0
如果你想改变版本,那么试试这个:
npm install --save react-native@0.44.0
npm install --save react@16.0.0-alpha.6
- 删除 node_modules 文件夹
编辑 Package.json
"dependencies": { "react": "15.6.0", "react-native": "0.45.0", },
- 运行 命令 'npm install'
您可以使用
启动应用程序react-native init --version="0.45.0" yourapp,
如果需要进一步更改,请在 package.json
或 react-native 字段中进行更改,然后简单地执行 npm install