我想升级到最新版本的博览会- SDK 47从SDK 44,我目前正在使用。我的npm版本是8.19.2,节点版本是16.18.2,如果它有助于。
当我尝试运行命令时:expo-cli升级时,我收到以下错误:
✖ Failed to install expo package with error: npm exited with non-zero code: 1
npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at NpmPackageManager._runAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:166:31)
at NpmPackageManager.installAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:82:16)
at NpmPackageManager.addWithParametersAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:96:18)
at NpmPackageManager.addAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:109:5)
at upgradeAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:496:7)
at actionAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:42:3)
在互联网上阅读了一点后,我试图删除“package.lock.json”文件,但我不知道为什么它会工作,因为它没有。
我还检查了“babel-preset-expo”,它被设置为9.0.2,因为它应该是根据另一篇文章。
如果这里有人能帮我解决这个问题,那就太好了。谢谢!
1条答案
按热度按时间kb5ga3dv1#
从SDK 44升级到v16.4.0时,我遇到了同样的问题。更改到v14.17.6或v19.1.0后,“expo upgrade”命令可以正常工作。这些是示例,我确信它可以与其他版本一起工作,只需自己测试即可。您可以在此链接上找到节点版本:https://nodejs.org/dist/index.json
如果你不想改变你的节点版本出于某种原因,我没有一个解决方案,然后。我目前在这种情况下,并寻找解决方案...