首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法生成Vue项目,因为“分配失败”

无法生成Vue项目,因为“分配失败”
EN

Stack Overflow用户
提问于 2020-02-03 21:44:00
回答 1查看 1.6K关注 0票数 0

我有一个VPS,想要构建一个vue-cli,在我运行'npm i‘之后,然后运行'npm run build’,它显示了这些错误,我想限制vue-cli的内存使用,以符合VPS规范

我用的是Ubuntu 19,内存是1 GB

代码语言:javascript
复制
> promoting_activation_front@0.1.0 build /var/www/promoting_frontend
> vue-cli-service build


⠙  Building for production...Starting type checking service...
Using 1 worker with 2048MB memory limit
⠦  Building for production...
<--- Last few GCs --->

[17469:0x5f3ce60]    73438 ms: Mark-sweep 485.2 (497.5) -> 482.1 (498.0) MB, 1062.6 / 0.0 ms  (average mu = 0.123, current mu = 0.034) allocation failure scavenge might not succeed
[17469:0x5f3ce60]    74265 ms: Mark-sweep 485.7 (498.0) -> 482.7 (498.5) MB, 810.5 / 0.0 ms  (average mu = 0.078, current mu = 0.021) allocation failure scavenge might not succeed


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x145cc79]
Security context: 0x1f245e040921 <JSObject>
    1: _walk [0x94962f2c7b9] [/var/www/promoting_frontend/node_modules/terser/dist/bundle.min.js:~1] [pc=0x27639ec77dca](this=0x29c90f60d7f1 <AST_Binary map = 0xba64fdfe151>,0x335b0e457b71 <bn map = 0x3d73333ce401>)
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20200203.130003.17469.0.001.json
Node.js report completed
 1: 0xa9d570 node::Abort() [node]
 2: 0xa9f832 node::OnFatalError(char const*, char const*) [node]
 3: 0xc0758e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xc07909 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xdb5e15  [node]
 6: 0xdb64a6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xdc4d19 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xdc5b55 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xdc862c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
11: 0x10dc52e v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x145cc79  [node]
Aborted (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! promoting_activation_front@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the promoting_activation_front@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-13 22:38:19

原因是我的内存很小,当我升级它的时候,错误没有发生

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60040513

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档