Github Action在上次“运行:npm运行构建”
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Error: Process completed with exit code 1.
我的工作流文件
name: Node.js CI
on:
push:
branches: ['master']
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i
- run: npm i
working-directory: client
- run: npm run build --if-present
working-directory: client
我认为这是解决办法
env:
NODE_OPTIONS: "--max-old-space-size=4096"
但它还没有工作,我不确定是否需要在env之前添加“-”以及它的确切位置...我在“run:npm运行build --如果存在工作目录:客户端”,但不起作用。
1条答案
按热度按时间ykejflvf1#
根据对类似问题的回应:
run
env
个