无法在 Raspberry Pi2 上安装 node.js' serialport npm 包
Unable to install node.js' serialport npm package on Raspberry Pi2
我想让Raspberry Pi 2 通过串行端口从另一个设备读取数据。但是,我无法安装 npm 的 serialport 包。我在 https://www.npmjs.com/package/serialport 上遵循了有关 Raspbian 的说明。我能够安装 Node 的 v0.10.12 和 npm 的 v1.2.32。但是当我尝试安装串口模块时,我在命令行中得到以下信息:
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm WARN package.json serialport@1.7.4 No readme data.
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/async/0.9.0
npm http GET https://registry.npmjs.org/sf/0.1.7
npm http GET https://registry.npmjs.org/bindings/1.2.1
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/sf/0.1.7
npm http 304 https://registry.npmjs.org/bindings/1.2.1
npm WARN package.json nan@1.8.4 No readme data.
npm WARN package.json optimist@0.6.1 No readme data.
npm http 304 https://registry.npmjs.org/async/0.9.0
npm ERR! Error: No compatible version found: debug@'^2.1.1'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.1.0","0.2.0","0.3.0","0.4.0","0.4.1","0.5.0","0.6.0","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.8.0","0.8.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","2.0.0","2.1.0","2.1.1","2.1.2","2.1.3","2.2.0"]
npm ERR! at installTargetsError (/opt/node/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR! at /opt/node/lib/node_modules/npm/lib/cache.js:641:10
npm ERR! at saved (/opt/node/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.18.11-v7+
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "install" "serialport"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.12
npm ERR! npm -v 1.2.32
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0
有什么问题?
您的 npm 版本不支持插入符 (^
) 版本说明符,因此您应该升级 npm。您可能也想升级节点。
我想让Raspberry Pi 2 通过串行端口从另一个设备读取数据。但是,我无法安装 npm 的 serialport 包。我在 https://www.npmjs.com/package/serialport 上遵循了有关 Raspbian 的说明。我能够安装 Node 的 v0.10.12 和 npm 的 v1.2.32。但是当我尝试安装串口模块时,我在命令行中得到以下信息:
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm WARN package.json serialport@1.7.4 No readme data.
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/async/0.9.0
npm http GET https://registry.npmjs.org/sf/0.1.7
npm http GET https://registry.npmjs.org/bindings/1.2.1
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/sf/0.1.7
npm http 304 https://registry.npmjs.org/bindings/1.2.1
npm WARN package.json nan@1.8.4 No readme data.
npm WARN package.json optimist@0.6.1 No readme data.
npm http 304 https://registry.npmjs.org/async/0.9.0
npm ERR! Error: No compatible version found: debug@'^2.1.1'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.1.0","0.2.0","0.3.0","0.4.0","0.4.1","0.5.0","0.6.0","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.8.0","0.8.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","2.0.0","2.1.0","2.1.1","2.1.2","2.1.3","2.2.0"]
npm ERR! at installTargetsError (/opt/node/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR! at /opt/node/lib/node_modules/npm/lib/cache.js:641:10
npm ERR! at saved (/opt/node/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.18.11-v7+
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "install" "serialport"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.12
npm ERR! npm -v 1.2.32
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0
有什么问题?
您的 npm 版本不支持插入符 (^
) 版本说明符,因此您应该升级 npm。您可能也想升级节点。