egret編譯 FATAL ERROR: CALL_AND_RETRY_0 Allocation failed process out of memory解決

egret 白鷺編譯時異常提示: FATAL ERROR: CALL_AND_RETRY_0 Allocation failed process out of memory.
 編譯時內存溢出, 由於白鷺編譯時使用的自帶的32位nodejs, 可換本身安裝的64位的nodejs.
解決方法:
1.安裝個64位的nodejs, 若是安裝在D:\Program Files\nodejs
2.修改C:\Users\登陸用戶名\AppData\Roaming\npm\egret.cmd文件, 設置路徑爲咱們安裝的64位nodejs
@SET NODE64=D:\Program Files\nodejs
@IF EXIST "%~dp0node_modules\egret\EgretEngine" (
  FOR /F "usebackq delims=" %%a in ("%~dp0node_modules\egret\EgretEngine") do @(set EGRET=%%a)
) ELSE (
  set EGRET=%~dp0node_modules
)

@IF EXIST "%NODE64%\node.exe" (
  "%NODE64%\node.exe" --max-old-space-size=4000 "%EGRET%\selector.js" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node --max-old-space-size=4000 "%EGRET%\selector.js" %*
)

  

2019.04.26更新:node

從官方下載最新的egret,上面改動後面編譯後還使用32位的nodejs編譯, 將引擎目錄下面的nodejs替換掉就行了。npm

使用本身安裝在d盤的,D:\Program Files\nodejs目錄下在的node.exe與D:\Program Files\nodejs\node_modules\npm文件夾bash

替換掉C:\Program Files (x86)\Egret\EgretLauncher\resources\app\engine\win目錄下面的node.exe與npm文件夾app

相關文章
相關標籤/搜索