When running npm install -g ionic I get the following error:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Is there a way to globally increase the node.js memory limit?

推荐答案

You can launch NPM using :

node --max-old-space-size=8000 $(which npm) install -g ionic

As described here, the default is 4000 (4Gb).

Node.js相关问答推荐

使用Vite和ReactJS时,在哪里设置NODE_OPTIONS?

Spotify Auth访问令牌给出错误代码400

Windows上使用ES6+的OpenAPI规范的Express服务器不接受嵌套路由'

如何解决TypeError:requ.isAuthenticated不是函数错误?

Stripe webhook无法访问Express请求原始正文

用于SLACK命令返回json而不是文本的AWS lambda函数

Prisma 和 Nextjs:重新部署之前内容不会更新

具有项目外部子路径导入的 Firebase 函数

未捕获的错误: 只能用作 元素的子元素,永远不会直接呈现.请将您的 包裹在

Cloudflare 522 错误 - javascript 客户端连接到 node 服务器

根据 mongoDB 中存在的唯一字符串生成唯一字符串的最佳方法

在本地运行 Cloud Functions 会出现错误functions.config() 不可用

如何在 NodeJS 中获取操作系统用户名?

我可以通过 JNI 从 Node.js 调用 Java 吗?如何?

Mongodb v4.0 Transaction, MongoError: Transaction numbers are allowed on a replica set member or mongos

通过 POST 请求将数据从 node.js 服务器发送到 node.js 服务器

如何在 NodeJS 中拆分和修改字符串?

node.js 示例

在 Node.js 中获取终端的宽度

nodejs - 临时文件名