npm 执行中遇到的问题

1. npm install 连接不到 registry

更换 npm registry:

 

 可以连接到 package 的仓库了,但是可能由于新仓库的某些原因,还是报错了。

2. npm run build 内存不够

ubuntu@ip-10-200-100-47:~/pinpoint-backend$ npm run build
> pinpoint-backend@0.0.1 prebuild /home/ubuntu/pinpoint-backend
> rimraf dist
> pinpoint-backend@0.0.1 build /home/ubuntu/pinpoint-backend
> nest build
<--- Last few GCs --->
[2667:0x438f440]    29476 ms: Mark-sweep 489.6 (493.3) -> 489.1 (493.3) MB, 788.7 / 0.0 ms  (average mu = 0.145, current mu = 0.043) allocation failure scavenge might not succeed
[2667:0x438f440]    30431 ms: Mark-sweep 489.8 (493.3) -> 489.4 (493.5) MB, 906.5 / 0.0 ms  (average mu = 0.096, current mu = 0.051) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
    0: ExitFrame [pc: 0x13a71b9]
Security context: 0x165d198008d1 <JSObject>
    1: getWidenedTypeWithContext(aka getWidenedTypeWithContext) [0x985c78905d9] [/home/ubuntu/pinpoint-backend/node_modules/typescript/lib/typescript.js:~48560] [pc=0x2c5421263069](this=0x183786cc04b1 <undefined>,0x1586cbccffe9 <TypeObject map = 0x1f87b1820379>,0x183786cc04b1 <undefined>)
    2: getTypeOfVariableOrParameterOrPropertyWorker(aka getTypeOfVariableOr...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Writing Node.js report to file: report.20200422.051346.2667.0.001.json
Node.js report completed
 1: 0x9ef190 node::Abort() [node]
 2: 0x9f13b2 node::OnFatalError(char const*, char const*) [node]
 3: 0xb5da9e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb5de19 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd0a765  [node]
 6: 0xd0adf6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xd1760a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xd18515 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xd1afcc v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xce19bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x10246ce v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x13a71b9  [node]
Aborted (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! pinpoint-backend@0.0.1 build: `nest build`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the pinpoint-backend@0.0.1 build 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!     /home/ubuntu/.npm/_logs/2020-04-22T05_13_46_737Z-debug.log

通过swap技术将硬盘空间作为内存之用

npm run build 内存溢出处理办法 - 掘金

ubuntu 16.04 - Delete a file that was created with fallocate - Server Fault

fallocate just creates a file, it does nothing specific to swap, so you can simply rm /swapfile.

If you had turned it into a swapfile with mkswap then swapon you can simply use swapoff /swapfile to stop your machine using it as swap.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值