gpt4 book ai didi

node.js - 世博会启动后崩溃

转载 作者:行者123 更新时间:2023-12-01 18:00:20 28 4
gpt4 key购买 nike

我在使用 expo start 启动 React Native 项目时遇到问题。
浏览器打开并显示以下页面:
Expo Browser

大约一秒钟后,页面完全变黑,控制台中出现以下错误(设置了 EXPO_DEBUG=true):

Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.

Metro Bundler process exited with code 1
Error: Metro Bundler process exited with code 1
at ChildProcess.<anonymous> (C:\@expo\xdl@56.2.8\src\Project.ts:1804:16)
at Object.onceWrapper (events.js:300:26)
at ChildProcess.emit (events.js:210:5)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我正在运行 Windows 10 1903 x64、NodeJs v12.11.0 和以下依赖项:

"dependencies": {
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"@types/react": "^16.8.23",
"@types/react-native": "^0.57.65",
"babel-preset-expo": "^7.0.0",
"typescript": "^3.4.5"
}

知道现在该怎么办吗?

最佳答案

只需要更改项目上的一些哈希值:前往:\node_modules\metro-config\src\defaults\blacklist.js

var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];

对此:

var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];

关于node.js - 世博会启动后崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58252849/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com