gpt4 book ai didi

node.js - 无法安装strongloop

转载 作者:搜寻专家 更新时间:2023-11-01 00:23:23 25 4
gpt4 key购买 nike

您好,我们尝试在几台运行 ubuntu 14.4 的不同服务器上安装 strongloop,但我们每次都会遇到同样的问题。它在同一步骤上失败。我们已经完全卸载了 node 和 npm,并按照有关在 ubuntu digital ocean 上安装的指南进行操作。我们甚至创建了一个预装 Node 的新 Droplet。没有运气。使用 centos 创建了一个 droplet 并按照说明进行操作。必须安装,但在运行 slc loopback 时,我们收到缺少模块的错误。

终端响应 `npm install -g strongloop

> utf-8-validate@1.2.1 install /usr/lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.40"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate/.node-gyp"
make: Entering directory `/usr/lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/usr/lib/node_modules/strongloop/node_modules/ws/node_modules/utf-8-validate/build'

> heapdump@0.3.7 install /usr/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.40"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump/.node-gyp"
make: Entering directory `/usr/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump/build'
CXX(target) Release/obj.target/addon/src/heapdump.o
SOLINK_MODULE(target) Release/obj.target/addon.node
SOLINK_MODULE(target) Release/obj.target/addon.node: Finished
COPY Release/addon.node
make: Leaving directory `/usr/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump/build'

> strong-agent@1.6.4 install /usr/lib/node_modules/strongloop/node_modules/strong-agent
> node-gyp rebuild || exit 0

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.10.40"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/strongloop/node_modules/strong-agent/.node-gyp"
make: Entering directory `/usr/lib/node_modules/strongloop/node_modules/strong-agent/build'
CXX(target) Release/obj.target/strong-agent/src/strong-agent.o
Killed
root@fabacustest1:~# SOLINK_MODULE(target) Release/obj.target/strong-agent.node
SOLINK_MODULE(target) Release/obj.target/strong-agent.node: Finished
COPY Release/strong-agent.node
make: Leaving directory `/usr/lib/node_modules/strongloop/node_modules/strong-agent/build'`

-- 它每次都停在上面。我们可以输入这让我们回到提示符。

任何帮助将不胜感激谢谢雷

最佳答案

我大胆猜测这个 Droplet 有 512mb 左右的 RAM,并且没有配置任何交换空间。

不幸的是,这没有足够的内存来运行 npm install -g strongloop。最简单的解决方案是简单地添加一些交换空间,这样内核就不会在内存不足时被迫杀死某些东西。

您可以像这样以根用户身份添加交换文件:

# dd if=/dev/zero of=/swap bs=1M count=1024 
# mkswap /swap
# swapon /swap

有关详细信息,请参阅 https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps

关于node.js - 无法安装strongloop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33430377/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com