gpt4 book ai didi

node.js - 错误 : Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

转载 作者:行者123 更新时间:2023-12-04 14:26:51 30 4
gpt4 key购买 nike

我正在尝试在我的本地主机中运行 nextjs 项目 http://localhost:3000通过做npm run dev但它给了我错误


<--- Last few GCs --->

[7144:0000023E7D8307E0] 100544 ms: Mark-sweep 2017.9 (2023.0) -> 2017.6 (2023.0) MB, 2836.9 / 0.1 ms (average mu = 0.114, current mu = 0.006) allocation failure scavenge might not succeed
[7144:0000023E7D8307E0] 103850 ms: Mark-sweep 2018.3 (2023.0) -> 2018.0 (2023.2) MB, 3299.7 / 0.1 ms (average mu = 0.058, current mu = 0.002) allocation failure scavenge might not succeed


<--- JS stacktrace --->

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

0: ExitFrame [pc: 00007FF6624B4DDD]
Security context: 0x0240ef4c08d1 <JSObject>
1: createElement(aka createElement) [000002B80EA54E01] [D:\Nitin\Practice UDEMY\SEO BLOG\frontend\node_modules\react\cjs\react.development.js:~727] [pc=00000262C81DBB66](this=0x03518e6804b1 <undefined>,0x03518e683eb9 <String[#4]: meta>,0x035350b9c5b9 <Object map = 0000028E2A4AC9E9>,0x03518e6804b1 <undefined>)
2: arguments adaptor frame: 2->3
3:...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20200507.191248.7144.0.001.json
Node.js report completed
1: 00007FF6618B363F napi_wrap+128063
2: 00007FF661852836 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+35142
3: 00007FF6618534F6 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+38406
4: 00007FF662069F4E private: void __cdecl v8::Isolate::ReportExternalAllocationLimitReached(void) __ptr64+94
5: 00007FF662052021 public: class v8::SharedArrayBuffer::Contents __cdecl v8::SharedArrayBuffer::Externalize(void) __ptr64+833
6: 00007FF661F1E57C public: static void __cdecl v8::internal::Heap::EphemeronKeyWriteBarrierFromCode(unsigned __int64,unsigned __int64,class v8::internal::Isolate * __ptr64)+1436
7: 00007FF661F297D0 public: void __cdecl v8::internal::Heap::ProtectUnprotectedMemoryChunks(void) __ptr64+1312
8: 00007FF661F262F4 public: static bool __cdecl v8::internal::Heap::PageFlagsAreConsistent(class v8::internal::HeapObject)+3204
9: 00007FF661F1BB13 public: bool __cdecl v8::internal::Heap::CollectGarbage(enum v8::internal::AllocationSpace,enum v8::internal::GarbageCollectionReason,enum v8::GCCallbackFlags) __ptr64+1283
10: 00007FF661F1A184 public: void __cdecl v8::internal::Heap::AddRetainedMap(class v8::internal::Handle<class v8::internal::Map>) __ptr64+2452
11: 00007FF661F3B36D public: class v8::internal::Handle<class v8::internal::HeapObject> __cdecl v8::internal::Factory::NewFillerObject(int,bool,enum v8::internal::AllocationType,enum v8::internal::AllocationOrigin) __ptr64+61
12: 00007FF661CA0C51 public: class v8::internal::interpreter::JumpTableTargetOffsets::iterator & __ptr64 __cdecl v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=(class v8::internal::interpreter::JumpTableTargetOffsets::iterator && __ptr64) __ptr64+1665
13: 00007FF6624B4DDD public: virtual bool __cdecl v8::internal::SetupIsolateDelegate::SetupHeap(class v8::internal::Heap
* __ptr64) __ptr64+546637
14: 00000262C81DBB66
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! frontend@1.0.0 dev: `next`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the frontend@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ganesh\AppData\Roaming\npm-cache\_logs\2020-05-07T13_43_08_709Z-debug.log

这是我发现的调试日志
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using npm@6.13.4
3 info using node@v12.16.1
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle frontend@1.0.0~predev: frontend@1.0.0
6 info lifecycle frontend@1.0.0~dev: frontend@1.0.0
7 verbose lifecycle frontend@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle frontend@1.0.0~dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Nitin\Practice UDEMY\SEO BLOG\frontend\node_modules\.bin;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\PostgreSQL\12\bin;C:\Program Files\Java\jdk-13\bin;C:\Users\Ganesh\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Ganesh\AppData\Roaming\npm;C:\Program Files\MongoDB\Server\4.2\bin;
9 verbose lifecycle frontend@1.0.0~dev: CWD: D:\Nitin\Practice UDEMY\SEO BLOG\frontend
10 silly lifecycle frontend@1.0.0~dev: Args: [ '/d /s /c', 'next' ]
11 silly lifecycle frontend@1.0.0~dev: Returned: code: 134 signal: null
12 info lifecycle frontend@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: frontend@1.0.0 dev: `next`
13 verbose stack Exit status 134
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:311:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:311:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid frontend@1.0.0
15 verbose cwd D:\Nitin\Practice UDEMY\SEO BLOG\frontend
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v12.16.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 134
22 error frontend@1.0.0 dev: `next`
22 error Exit status 134
23 error Failed at the frontend@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]

我也尝试按照此处的建议解决问题
How to fix “FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory” error但它对我不起作用

这是我的 package.json
{
"name": "frontend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "next",
"build": "next build --max_old_space_size=4096",
"start": "next start --max_old_space_size=4096"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@zeit/next-css": "^1.0.1",
"isomorphic-fetch": "^2.2.1",
"js-cookie": "^2.2.1",
"moment": "^2.24.0",
"next": "^9.3.5",
"nprogress": "^0.2.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-quill": "^1.3.5",
"react-render-html": "^0.6.0",
"reactstrap": "^8.4.1"
}
}

最佳答案

我遇到过同样的问题,

我尝试将 Node 版本从 12.x 降级至 10.x它似乎工作正常。

希望能帮助到你。

Nodejs download v10.x

关于node.js - 错误 : Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61659785/

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