gpt4 book ai didi

node.js - react-scripts启动错误代码为134,未启动应用程序

转载 作者:行者123 更新时间:2023-12-03 12:33:59 25 4
gpt4 key购买 nike

我正在尝试使用react.js为Windows创建一个简单的 Electron 应用程序。一切都很好,突然,我遇到了一些错误,这不允许我运行该应用程序:

错误:https://pastebin.com/awMi4UBM(react-scripts start)

错误:https://pastebin.com/xeH3A1Dx(rescripts start)

我的package.json部分:

   ....
"scripts": {
"start": "rescripts start",
"startb": "react-scripts start",
"build": "rescripts build",
"test": "rescripts test",
"eject": "react-scripts eject",
"postinstall": "electron-builder install-app-deps",
"preelectron-pack": "yarn build",
"electron-pack": "electron-builder build -mw",
"electron-dev": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\""
},
...

也粘贴在这里:
react-scripts start错误:
yarn run v1.17.3
$ react-scripts start
i 「wds」: Project is running at http://0.0.0.0:3000/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from E:\gits\telapoka-dev\telapoka-react\public
i 「wds」: 404s will fallback to /index.html
Starting the development server...


<--- Last few GCs --->

[2260:0000019DDCF58EB0] 134175 ms: Scavenge 1375.7 (1424.0) -> 1375.4 (1424.5) MB, 11.0 / 0.0 ms (average mu = 0.124, current mu = 0.023) allocation failure
[2260:0000019DDCF58EB0] 137527 ms: Mark-sweep 1376.1 (1424.5) -> 1375.8 (1424.5) MB, 3339.8 / 0.0 ms (average mu = 0.070, current mu = 0.014) allocation failure scavenge might not su
cceed


<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0000001B64F5C5C1]
1: StubFrame [pc: 0000001B64F4EC05]
Security context: 0x03045269e6e9 <JSObject>
2: replace [00000304526905E9](this=0x03b789806cc9 <String[80]: E:\gits\telapoka-dev\telapoka-react\node_modules\react-file-viewer\dist\index.js>,0x014e3ebde1c1 <JSRegExp <String[2]:
\\>>,0x014cc71b23e1 <String[1]: />)
3: _append [000001ED43DEE861] [E:\gits\telapoka-dev\telapoka-react\node_modules\@babel\gener...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF761E3C6AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
2: 00007FF761E17416 node::MakeCallback+4534
3: 00007FF761E17D90 node_module_register+2032
4: 00007FF76213189E v8::internal::FatalProcessOutOfMemory+846
5: 00007FF7621317CF v8::internal::FatalProcessOutOfMemory+639
6: 00007FF762317F94 v8::internal::Heap::MaxHeapGrowingFactor+9620
7: 00007FF76230EF76 v8::internal::ScavengeJob::operator=+24550
8: 00007FF76230D5CC v8::internal::ScavengeJob::operator=+17980
9: 00007FF762316317 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF762316396 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF762440637 v8::internal::Factory::NewFillerObject+55
12: 00007FF7624BD826 v8::internal::operator<<+73494
13: 0000001B64F5C5C1
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Process finished with exit code 134
rescripts start错误:
yarn electron-dev
yarn run v1.17.3
$ concurrently "BROWSER=none yarn start" "wait-on http://localhost:3000 && electron ."
[0] 'BROWSER' is not recognized as an internal or external command,
[0] operable program or batch file.
[0] BROWSER=none yarn start exited with code 1

依存关系:
  "dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.2",
"concurrently": "^5.1.0",
"copy-clipboard-js": "^1.0.3",
"dialog": "^0.3.1",
"electron-is-dev": "^1.1.0",
"fs": "^0.0.1-security",
"react": "^16.12.0",
"react-ace": "^8.0.0",
"react-awesome-button": "^6.5.1",
"react-collapsible": "^2.6.2",
"react-dom": "^16.12.0",
"react-file-viewer": "^1.2.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"react-welcome-page": "^0.2.1",
"remote": "^0.2.6",
"wait-on": "^4.0.0"
},

DevDependencies:
  "devDependencies": {
"@rescripts/cli": "^0.0.13",
"@rescripts/rescript-env": "^0.0.11",
"electron": "^8.0.0",
"electron-builder": "^22.3.2",
"typescript": "^3.7.5"
},

最佳答案

  • 删除node_modules
  • 清除缓存
  • 删除temp文件夹 s
  • 删除package_lock.json(如果存在)(如果使用npm,则应存在)或yarn.lock(如果使用yarn),则删除
  • 在我们使用react时,使用npm install可能会引起一些问题是非正式的官方消息,请使用 yarn install

  • 一切都应该正常工作。

    关于node.js - react-scripts启动错误代码为134,未启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60086317/

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