【问题标题】:"Process out of memory" error after installing node from source从源安装节点后出现“进程内存不足”错误
【发布时间】:2018-11-01 15:07:33
【问题描述】:

我正在尝试在共享主机上安装 NodeJS。我从

下载了源代码

https://nodejs.org/en/download/

并使用./config --prefix="$HOME/local" 遵循通常的安装过程。

它编译没有错误。但是,当我尝试运行它时,出现以下错误:

installing /kunden/homepages/32/d690510543/htdocs/local/include/node/zconf.h
installing /kunden/homepages/32/d690510543/htdocs/local/include/node/zlib.h
(uiserver):xxxxxxxx:~/node-v8.11.2$ which node
/kunden/homepages/32/d690510543/htdocs/local/bin/node
(uiserver):xxxxxxxx:~/node-v8.11.2$ node


#
# Fatal error in , line 0
# API fatal error handler returned after process out of memory
#
Illegal instruction

但是,我可以得到版本

$ node -v
v8.11.2

和帮助。

不过,我无法运行脚本

(uiserver):xxxxxxxx:~$ cat hello.js
var http = require('http');
http.createServer(function (req, res) {
        res.writeHead(200, {'Content-Type': 'text/plain'});
        res.end('Hello World\n');
        }).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
(uiserver):xxxxxxxx:~$ node hello.js


#
# Fatal error in , line 0
# API fatal error handler returned after process out of memory
#
Illegal instruction

我也无法输入 REPL:

(uiserver):xxxxxxxx:~$ node -i

#

致命错误,第 0 行

处理内存不足后返回的 API 致命错误处理程序

# 非法指令

【问题讨论】:

    标签: node.js installation shared-hosting


    【解决方案1】:

    当我使用命令执行我的 Vue.js 项目时:

    npm  run dev
    

    在 webstorm 控制台中,控制台输出:

    # Fatal error in , line 0
    # API fatal error handler returned after process out of memory
    

    然后当我重新启动使用命令:

    npm run dev
    

    webstorm 崩溃,我重新启动 webstorm 并使用命令:

    npm run dev
    

    第二次,它工作。所以我认为是因为webstorm启动太多子进程时我的电脑内存不够。

    【讨论】:

      【解决方案2】:

      我有同样的问题,我意识到它只发生在我使用 mlab 沙箱 mongo db 时。最初一切正常,即使使用 mlab mongo db,但突然间我开始出现错误。我改为本地安装mongodb,一切都很好,我删除了我的 mlab mongo db 集合并改回 mlab,一切都很好。我想问题是 mlab 免费层限制

      【讨论】:

        【解决方案3】:

        有同样的问题(和 afaik 相同的托管服务提供商)。但是,通过 nvm 安装节点,如所述,例如https://stackoverflow.com/a/33857377/1680728 确实为我解决了这个问题。我不知道它是某种环境设置还是与获取的二进制文件/版本有关。

        所以,我无法解决“进程内存不足”错误,但我想真正的问题是让任何 nodejs 版本在共享主机上运行。

        【讨论】:

          【解决方案4】:

          我遇到了同样的问题,我关闭了我的 webstorme 并重试

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2020-04-25
            • 2011-05-16
            • 1970-01-01
            • 2015-01-27
            • 1970-01-01
            • 2016-01-06
            相关资源
            最近更新 更多