无法在Raspberry Pi2

时间:2015-08-26 23:56:37

标签: node.js raspberry-pi raspbian raspberry-pi2

我希望Raspberry Pi 2通过串口从其他设备读取数据。但是,我无法安装npm的serialport包。我在https://www.npmjs.com/package/serialport上遵循了有关Raspbian的说明。我能够安装Node的v0.10.12和npm的v1.2.32。但是当我尝试安装serialport模块时,我在命令行中得到以下内容:

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

有什么问题?

1 个答案:

答案 0 :(得分:0)

您的npm版本不支持插入符号(^)版本说明符,因此您应该升级npm。您可能也想要升级节点。