2022-10-17 08:24:35 +00:00
|
|
|
|
---
|
2024-05-13 08:39:29 +00:00
|
|
|
|
title: 🫒npm出现error:0308010C:digital envelope routines::unsupported错误解决
|
2022-10-17 08:24:35 +00:00
|
|
|
|
date: 2022-10-15
|
2024-05-13 08:39:29 +00:00
|
|
|
|
tags:
|
|
|
|
|
- Npm
|
|
|
|
|
- Node
|
2022-10-17 08:24:35 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
搜索一下可能与node的版本有关,目前可以确认node17以下没啥问题,node18以上需要执行如下命令:
|
|
|
|
|
|
2023-07-09 03:48:43 +00:00
|
|
|
|
```sh
|
2022-10-17 08:24:35 +00:00
|
|
|
|
export NODE_OPTIONS=--openssl-legacy-provider
|
|
|
|
|
```
|
2024-05-13 08:39:29 +00:00
|
|
|
|
|
|
|
|
|
内存溢出的错误如下所示:
|
|
|
|
|
|
|
|
|
|
> <--- JS stacktrace --->
|
|
|
|
|
>>FATAL ERROR: Ineffective mark-compacts near heap limit Allocationfailed - JavaScript heap out of memory
|
|
|
|
|
>>
|
|
|
|
|
>----- Native stack trace ----
|
|
|
|
|
|
|
|
|
|
解决办法如下:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
#linux
|
|
|
|
|
export NODE_OPTIONS="--max-old-space-size=(X * 1024)" # Increase to X GB
|
|
|
|
|
#windows
|
|
|
|
|
set NODE_OPTIONS="--max-old-space-size=(X * 1024)" # Increase to X GB
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
参考连接:https://stackoverflow.com/questions/50230339/npm-error-0308010c-digital-envelope-routines-unsupported
|