yarn --version返回1.15.2,但在package.json中为1.19.1

问题描述 投票:0回答:1

我只是将React Native 0.61.2应用程序上的yarn重新安装到最新的1.19.1。

 npm install yarn

然后用yarn install重新安装模块,

 yarn install

然后yarn --version在package.json中仍为1.19.1时再次返回1.15.2。这是package.json:

"dependencies": {
    "@react-native-community/async-storage": "^1.6.2",
    "moment": "^2.24.0",
    "react": "16.11.0",
    "react-native": "0.61.2",
    "react-native-cli": "^2.0.1",
    "react-native-confirmation-code-field": "^4.1.0",
    "react-native-device-info": "^4.0.1",
    "react-native-elements": "^1.2.6",
    "react-native-gesture-handler": "^1.4.1",
    "react-native-gifted-chat": "^0.11.3",
    "react-native-keychain": "^4.0.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^1.3.1",
    "react-native-modal": "^11.4.0",
    "react-native-modal-datetime-picker": "^7.6.0",
    "react-native-reanimated": "^1.3.0",
    "react-native-segmented-control-tab": "^3.4.1",
    "react-native-vector-icons": "^6.6.0",
    "react-native-video": "^5.0.2",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.10.2",
    "react-navigation-tabs": "^2.5.6",
    "socket.io-client": "2.3.0",
    "yarn": "^1.19.1"
  },

安装的yarn怎么了?

react-native yarn
1个回答
1
投票

如果您具有全局包装的纱线,则可能返回全局纱线的版本。如果要确定项目的纱线版本,则需要检查项目的“ node_modules”文件。最后但并非最不重要的一点是,在安装新的次要版本的软件包之前,应删除“ package-lock.json”“ yarn.lock”文件。

© www.soinside.com 2019 - 2024. All rights reserved.