【发布时间】:2020-08-15 18:34:28
【问题描述】:
这个问题困扰我很久了,我看到很多人在这里问同样的问题,尝试了所有方法但还是不行。
我试过卸载node、expo-cli、删除.expo、关闭所有本地端口,但是一直显示这个错误。这是错误的完整日志: 附言。我使用的是 Mac,之前安装过 Flutter,不知道会不会导致错误。
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.13.4
3 info using node@v12.14.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/lucas/Desktop/Coding/ReactNative/Project/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/lucas/Desktop/flutter/flutter/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/lucas/.npm-global/bin:/Users/lucas/.npm-global/bin
9 verbose lifecycle @~start: CWD: /Users/lucas/Desktop/Coding/ReactNative/Project
10 silly lifecycle @~start: Args: [ '-c', 'expo start' ]
11 silly lifecycle @~start: Returned: code: 1 signal: null
12 info lifecycle @~start: Failed to exec start script
13 verbose stack Error: @ start: `expo start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:223:5)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:223:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd /Users/lucas/Desktop/Coding/ReactNative/Project
16 verbose Darwin 18.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v12.14.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error @ start: `expo start`
22 error Exit status 1
23 error Failed at the @ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
当我输入我的本地主机时,它会显示正常的 Metro 页面,但大约 5 秒后页面变黑并显示消息 Connecting to Metro bundler failed.。
有人知道怎么解决吗?
【问题讨论】:
标签: reactjs react-native expo