为 ARM 处理器生成文件系统和交叉编译工具时无法添加串口(nodejs 模块)

为 ARM 处理器生成文件系统和交叉编译工具时无法添加串口(nodejs 模块)

我使用buildroot(版本2013.08.1)生成文件系统和交叉编译工具,以在i.MX233处理器(ARM架构)上实现嵌入式linux。我通过运行make menuconfig然后选择添加串行端口模块:

Target Package --> 
    Interpreter languages and scripting --> 
        [*]nodejs
            [*] NPM for the target
            [*] Express web application framework
            [*] CoffeeScript
            (socket.io jade serialport) Additional modules

运行 Makefile 时,我得到以下有关串行端口模块的输出:

node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.11-linux-x64.tar.gz
node-pre-gyp http 200 https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.11-linux-x64.tar.gz
node-pre-gyp ERR! UNCAUGHT EXCEPTION 
node-pre-gyp ERR! stack Error: EPERM, chmod '/media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/node_modules/serialport/build/serialport/v1.4.0/Release/v8-3.11-linux-x64/serialport.node'
node-pre-gyp ERR! System Linux 3.13.0-24-generic
node-pre-gyp ERR! command "node" "/media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/node_modules/serialport
node-pre-gyp ERR! node -v v0.8.22
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! `sh "-c" "node-pre-gyp install --fallback-to-build"` failed with 7
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/media/d/Documents/b-tesis/buildroot-2013.08.1/output/host/usr/bin/node" "/media/d/Documents/b-tesis/buildroot-2013.08.1/output/host/usr/bin/npm" "install" "express" "coffee-script" "socket.io" "jade" "serialport"
npm ERR! cwd /media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib
npm ERR! node -v v0.8.22
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/npm-debug.log
npm ERR! not ok code 0
make: *** [/media/d/Documents/b-tesis/buildroot-2013.08.1/output/build/nodejs-0.8.22/.stamp_target_installed] Error 1

我尝试使用安装不同的节点版本nvm,但它不起作用。我在谷歌上没有找到任何不同的解决方案。

我正在使用 Ubuntu 14.04 和内核版本 3.13.0-24-generic 的计算机上执行此过程。

对于这个问题的任何帮助,我将不胜感激。

答案1

您可以将此错误报告给 Buildroot 错误跟踪器吗?https://bugs.busybox.net

答案2

您需要有 root 权限才能安装这些本机模块(如 serialport)。

走进/buildroot/package/nodejs/nodejs.mk并改变

$(NPM) install -g $(NODEJS_MODULES_LIST)

$(NPM) install -g --unsafe-perm $(NODEJS_MODULES_LIST)

相关内容