1

我正在尝试在树莓派上安装 npm 模块 bmp085,但我不断收到错误消息。Node-Red 已安装并在 Pi 上运行。我不太了解错误消息在抱怨什么,我认为它在抱怨版本,但我不知道哪个版本和什么。据 apt 所说,一切都是最新的和最新的版本。

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 4.1.7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/node-red-contrib-bmp085/node_modules/bmp085/node_modules/i2c
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
npm ERR! Linux 4.1.7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "--unsafe-perm" "node-red-contrib-bmp085"
npm ERR! node v0.12.6
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! i2c@0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the i2c@0.1.8 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the i2c package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls i2c
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/rpi/node-red/npm-debug.log

我看过提到的日志,我也不明白。

4

1 回答 1

1

正如错误所说,这是构建 i2c 模块的问题。

由于您正在运行节点 0.12,因此可能需要更新 bmp085 模块以使用更新版本的 i2c 模块,因为 i2c 模块的Github页面建议您需要大于 0.1.8 的版本才能更新节点 0.11

目前最新版本为 0.2.0

于 2015-11-19T22:24:03.417 回答