简体   繁体   中英

Error while ejecting Expo Project to Bare React Native

I am currently attempting to eject an app I have created in expo and uploaded to the App Store to bare react native. There are some features I would like to implement that I can not seem to find a solution to using expo and I wold also like to expand my react native knowledge. However, Whenever I run " expo eject" I receive the errors below.

Eject Expo Error

40991 info lifecycle firebase@7.5.2~postinstall: firebase@7.5.2

40992 silly postinstall jest@24.1.0 40993 info lifecycle jest@24.1.0~postinstall: jest@24.1.0 40994 silly postinstall metro-react-native-babel-preset@0.54.0 40995 info lifecycle metro-react-native-babel-preset@0.54.0~postinstall: metro-react-native-babel-preset@0.54.0 40996 silly postinstall react@16.8.3 40997 info lifecycle react@16.8.3~postinstall: react@16.8.3 40998 silly postinstall react-dom@16.8.3 40999 info lifecycle react-dom@16.8.3~postinstall: react-dom@16.8.3 41000 silly postinstall react-native@0.59.10 41001 info lifecycle react-native@0.59.10~postinstall: react-native@0.59.10 41002 silly postinstall react-native-gesture-handler@1.3.0 41003 info lifecycle react-native-gesture-handler@1.3.0~postinstall: react-native-gesture-handler@1.3.0 41004 silly postinstall react-native-paper@2.16.0 41005 info lifecycle react-native-paper@2.16.0~postinstall: react-native-paper@2.16.0 41006 silly postinstall react-native-reanimated@1.1.0 41007 info lifecycle react-native-reanimated@1.1.0~ postinstall: react-native-reanimated@1.1.0 41008 silly postinstall react-native-unimodules@0.5.4 41009 info lifecycle react-native-unimodules@0.5.4~postinstall: react-native-unimodules@0.5.4 41010 verbose lifecycle react-native-unimodules@0.5.4~postinstall: unsafe-perm in lifecycle true 41011 verbose lifecycle react-native-unimodules@0.5.4~postinstall: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/kj/Downloads/obey/node_modules/react-native-unimodules/node_modules/.bin:/Users/kj/Downloads/obey/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Users/kj/Library/Android/sdk/emulator:/Users/kj/Library/Android/sdk/tools:/Users/kj/Library/Android/sdk/tools/bin:/Users/kj/Library/Android/sdk/platform-tools 41012 verbose lifecycle react-native-unimodules@0.5.4~postinstall: CWD: /Users/kj/Downloads/obey/node_modules/react-native-unimodules 41013 silly lifecycle react-native-unimodules@0.5.4~postinstall : Args: [ '-c', 'node ./scripts/postinstall.js' ] 41014 silly lifecycle react-native-unimodules@0.5.4~postinstall: Returned: code: 0 signal: null 41015 silly postinstall react-native-video@5.0.0 41016 info lifecycle react-native-video@5.0.0~postinstall: react-native-video@5.0.0 41017 silly postinstall react-native-web@0.11.7 41018 info lifecycle react-native-web@0.11.7~postinstall: react-native-web@0.11.7 41019 silly postinstall react-navigation@2.18.3 41020 info lifecycle react-navigation@2.18.3~postinstall: react-navigation@2.18.3 41021 silly postinstall react-test-renderer@16.8.3 41022 info lifecycle react-test-renderer@16.8.3~postinstall: react-test-renderer@16.8.3 41023 silly postinstall sharp@0.23.3 41024 info lifecycle sharp@0.23.3~postinstall: sharp@0.23.3 41025 timing action:postinstall Completed in 2042ms 41026 verbose unlock done using /Users/kj/.npm/_locks/staging-32a5fd08273bf931.lock for /Users/kj/Downloads/obey/node_modules/.staging 41027 timing stage:executeActions Comp leted in 40882ms 41028 timing stage:rollbackFailedOptional Completed in 3ms 41029 silly install runPostinstallTopLevelLifecycles 41030 silly build obey@0.0.0 41031 info linkStuff obey@0.0.0 41032 silly linkStuff obey@0.0.0 has /Users/kj/Downloads as its parent node_modules 41033 silly install obey@0.0.0 41034 info lifecycle obey@0.0.0~install: obey@0.0.0 41035 silly postinstall obey@0.0.0 41036 info lifecycle obey@0.0.0~postinstall: obey@0.0.0 41037 verbose lifecycle obey@0.0.0~postinstall: unsafe-perm in lifecycle true 41038 verbose lifecycle obey@0.0.0~postinstall: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/kj/Downloads/obey/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Users/kj/Library/Android/sdk/emulator:/Users/kj/Library/Android/sdk/tools:/Users/kj/Library/Android/sdk/tools/bin:/Users/kj/Library/Android/sdk/platform-tools 41039 verbose lifecycle obey@0.0.0~postinstall: CWD: /User s/kj/Downloads/obey 41040 silly lifecycle obey@0.0.0~postinstall: Args: [ '-c', 'jetify' ] 41041 info lifecycle obey@0.0.0~postinstall: Failed to exec postinstall script 41042 verbose stack Error: obey@0.0.0 postinstall: jetify 41042 verbose stack spawn ENOENT 41042 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18) 41042 verbose stack at ChildProcess.emit (events.js:198:13) 41042 verbose stack at maybeClose (internal/child_process.js:982:16) 41042 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 41043 verbose pkgid obey@0.0.0 41044 verbose cwd /Users/kj/Downloads/obey 41045 verbose Darwin 19.0.0 41046 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” 41047 verbose node v10.16.3 41048 verbose npm v6.13.7 41049 error code ELIFECYCLE 41050 error syscall spawn 41051 error file sh 41052 error errno ENOENT 41053 error obey@0.0.0 postinstall: jetify 41053 error spawn ENOENT 41054 error Failed at the obey@0.0.0 postinstall script. 41054 error This is probably not a problem with npm. There is likely additional logging output above. 41055 verbose exit [ 1, true ]

This error is because you haven't installed jetifier as a dependency in your package.json . From your feedback I can see that you used

npm install --save-dev jetifier

What this did was install jetifier as a dev dependency. A dev dependency is a way to use packages during development but prevent them from being used in your production environment. So for example I use a package mjml that builds html for emails. I only use it to transpile code, it's not a part of my website, so I use it as a dev dependency.

What you need to do is

npm install --save jetifier

(I never actually use the --save part myself)

This saves it as a dependency you can use in production. When you ejected your app, it was ejecting only production dependencies, but one of your files require 'd jetifier . Hence the error :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM