create-react-native-app
コマンドを使用して、1ヶ月前に作成されたReact Nativeプロジェクトがあります。ネイティブのpackage.jsonのバージョンに対応します
package.json
内容は次のとおりである:私は今日のプロジェクトを作成すると
{
"name": "TestApp2",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.1.0",
"jest-expo": "~19.0.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^19.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.46.1"
}
}
、package.json
は以下の通りです:
{
"name": "NewApp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.5.0",
"jest-expo": "^21.0.2",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^21.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.48.4"
}
}
react-native-scripts
、jest-expo
とexpo
のバージョンがあることに注意してください異なる。私の質問は、どうすればバージョンをアップグレードできますか?手動でバージョン番号を変更するだけでいいですか?
私が使用してみました:
$ npm install -g react-native-git-upgrade
$ react-native-git-upgrade
しかし、それはバージョンをアップグレードしません。
私も試してみました:
$ npm update
$ react-native upgrade
しかし、両方のコマンドは、バージョンが更新されません。
'npm update'に' package.json'で指定されたバージョンをアップグレードさせる代替方法はありますか? – Raptor