linux - 无法在 Raspbian 上编译 iotivity 节点

标签 linux ubuntu raspberry-pi raspbian iotivity

无法在Raspberry pi 3 开发板上编译Raspbian OS 上的iotivity-node 源代码。但是,我能够在 Ubuntu 16.04 LTS 操作系统下的笔记本电脑中成功编译相同的源代码。

我在屏幕上遇到了以下错误消息。 有谁知道如何解决这个问题?谢谢。 (请参阅我的要点中的完整日志。iotivity-node fail log

> COPY Release/nothing.node  
  CXX(target) Release/obj.target/iotivity/generated/constants.o  
virtual memory exhausted: Cannot allocate memory  
iotivity.target.mk:131: recipe for target 
 elease/obj.target/iotivity/generated/constants.o' failed  
make: *** [Release/obj.target/iotivity/generated/constants.o] Error 1  
make: Leaving directory '/home/pi/workspace/iotivity-node/build'  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack     at ChildProcess.onExit 
 (/home/pi/.nvm/versions/node/v9.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)  
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)  
gyp ERR! stack     at Process.ChildProcess._handle.onexit  
(internal/child_process.js:209:12)  
gyp ERR! System Linux 4.9.59-v7+
gyp ERR! command "/home/pi/.nvm/versions/node/v9.5.0/bin/node" 
 "/home/pi/.nvm/versions/node/v9.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"  
gyp ERR! cwd /home/pi/workspace/iotivity-node  
gyp ERR! node -v v9.5.0  
gyp ERR! node-gyp -v v3.6.2  
gyp ERR! not ok  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! iotivity-node@1.3.1-0 install: `node-gyp rebuild`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the iotivity-node@1.3.1-0 install script.  
npm ERR! This is probably not a problem with npm. There is likely additional  logging output above.  

最佳答案

我猜你需要给你的 Pi 添加更多内存:

查看这篇关于在 ARM 上构建 iotivity 的帖子:

https://blogs.s-osg.org/building-iotivity-arm-artik-devices/

应该很容易适应基于 debian 的发行版,

例如通过 NFS

文件=“$mnt/swap.tmp” dd if=/dev/zero of=$file bs=1k count=2097152 # 2GB losetup/dev/loop0 "$文件" mkswap/dev/loop0 swapon/dev/loop0

关于linux - 无法在 Raspbian 上编译 iotivity 节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48559895/

相关文章:

php - 在 Linux 上为 PHP5 配置 xDebug

ubuntu - NGINX安装错误

c++ - 无法识别的命令行选项 “-std=c++11”

python - 将蓝牙名称更改为 Pi Zero 上的当前 IP 地址

linux - Python 更新 Linux (Raspberry Pi)

c - 客户端程序中的段错误

c - strcpy 到 mmap 地址返回总线错误

linux - 为什么这段代码可以在 Linux 上运行,但不能在 SunOS 上运行?

linux - 捕获到/dev/tty 的直接重定向

java - 透明框架在 Windows 中可以正常工作,但在 Linux 中不能