I want the Raspberry Pi 2 to read data from another device through the Serial port. However, I cannot install the npm's serialport package. I followed the instructions about Raspbian on https://www.npmjs.com/package/serialport. I was able to install v0.10.12 of Node and v1.2.32 of npm. But when I try installing the serialport module I get the following in the command line:
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
What is the problem?
Your version of npm does not support the caret (^) version specifier, so you should upgrade npm. You will probably also want to upgrade node too.
Related
I've tried to install this wordpress template, which relies on some node modules for a gulp file, on a Windows PC.
The output of npm install is the following:
$ npm install
npm WARN package.json gulp-wordpress-template#0.0.1 No repository field.
npm http GET https://registry.npmjs.org/gulp-load-plugins
npm http GET https://registry.npmjs.org/gulp-autoprefixer
npm http GET https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/browser-sync
npm http 304 https://registry.npmjs.org/gulp-autoprefixer
npm ERR! Error: No compatible version found: gulp-autoprefixer#'^1.0.1'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9
","0.0.10","1.0.0","1.0.1","2.0.0","2.1.0"]
npm ERR! at installTargetsError (c:\Program Files\nodejs\node_modules\npm\li
b\cache.js:719:10)
npm ERR! at c:\Program Files\nodejs\node_modules\npm\lib\cache.js:638:10
npm ERR! at saved (c:\Program Files\nodejs\node_modules\npm\node_modules\npm
-registry-client\lib\get.js:142:7)
npm ERR! at c:\Program Files\nodejs\node_modules\npm\node_modules\graceful-f
s\polyfills.js:133: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 Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd c:\Users\USER\Desktop\wordpress-test
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm http 304 https://registry.npmjs.org/gulp-load-plugins
npm http 304 https://registry.npmjs.org/gulp
npm http GET https://registry.npmjs.org/gulp-connect-php
npm http GET https://registry.npmjs.org/gulp-shell
npm http GET https://registry.npmjs.org/gulp-sass
npm http 304 https://registry.npmjs.org/browser-sync
npm http 304 https://registry.npmjs.org/gulp-sass
npm http 304 https://registry.npmjs.org/gulp-connect-php
npm http 304 https://registry.npmjs.org/gulp-shell
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\Users\USER\Desktop\wordpress-test\npm-debug.log
npm ERR! not ok code 0
According to the error, gulp-autoprefixer isn't available in version ^1.0.1. What is strange, is that below it suggests that 1.0.1 is a valid version.
What's even more strange, is that I can flawlessly install the package on an OSX machine.
I thought node is cross platform – is there something I am missing?
You need a newer version of npm that supports the ^ character in the version fields. The easiest way is to this is to just upgrade node (the latest stable being v0.10.35 as of this writing).
Im trying to install gulp-browserify with this command:
npm install gulp-browserify --save-dev
I already installed many other packages successfully like
gulp-autoprefixer
gulp-concat
gulp-minify-css
gulp-sass
gulp-uglify
all of those installations worked great, here is how my package.json file looks like
{
"devDependencies": {
"gulp-autoprefixer": "0.0.8",
"gulp-sass": "~0.7.2",
"gulp": "~3.8.5",
"gulp-minify-css": "~0.3.6",
"gulp-concat": "~2.2.0",
"gulp-uglify": "~0.3.1"
}
}
and here is the errors I get when installing browserify
http GET https://registry.npmjs.org/uglify-to-browserify
npm http 200 https://registry.npmjs.org/inline-source-map
npm http GET https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.3.0.tgz
npm ERR! Error: invalid version: 3001.0001.0000-dev-harmony-fb
npm ERR! at validVersion (/usr/lib/nodejs/read-package-json/read-json.js:573:40)
npm ERR! at final (/usr/lib/nodejs/read-package-json/read-json.js:323:23)
npm ERR! at /usr/lib/nodejs/read-package-json/read-json.js:139:33
npm ERR! at cb (/usr/lib/nodejs/slide/lib/async-map.js:48:11)
npm ERR! at /usr/lib/nodejs/read-package-json/read-json.js:251:40
npm ERR! at fs.js:268:14
npm ERR! at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /media/tzookb/dynamic/www/meeters/npm-debug.log npm
npm ERR! System Linux 3.11.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "gulp-browserify" "--save-dev"
npm ERR! cwd /media/tzookb/dynamic/www/meeters
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm http 200 https://registry.npmjs.org/escodegen
npm http GET https://registry.npmjs.org/escodegen/-/escodegen-1.1.0.tgz
npm http 200 https://registry.npmjs.org/callsite
npm http GET https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz
npm http 200 https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz
npm http 200 https://registry.npmjs.org/astw
npm http GET https://registry.npmjs.org/astw/-/astw-1.1.0.tgz
npm http 200 https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz
npm http 200 https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.4.tgz
npm http 200 https://registry.npmjs.org/source-map
npm http GET https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz
npm http 200 https://registry.npmjs.org/source-map
npm http 200 https://registry.npmjs.org/uglify-to-browserify
npm http GET https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz
npm http 200 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/async/-/async-0.2.10.tgz
npm http 200 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz
npm http 200 https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.3.0.tgz
npm http 200 https://registry.npmjs.org/escodegen/-/escodegen-1.1.0.tgz
npm http 200 https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz
npm http 200 https://registry.npmjs.org/astw/-/astw-1.1.0.tgz
npm http 200 https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz
npm http 200 https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.2.10.tgz
npm http 200 https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz
npm http GET https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz
npm http 200 https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/amdefine
npm http 200 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 https://registry.npmjs.org/amdefine
npm http GET https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz
npm http 200 https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz
npm ERR! Error: ENOENT, lstat '/media/tzookb/dynamic/www/meeters/node_modules/gulp-browserify/node_modules/browserify/node_modules/umd/node_modules/ruglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /media/tzookb/dynamic/www/meeters/npm-debug.log npm
npm ERR! System Linux 3.11.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "gulp-browserify" "--save-dev"
npm ERR! cwd /media/tzookb/dynamic/www/meeters
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! path /media/tzookb/dynamic/www/meeters/node_modules/gulp-browserify/node_modules/browserify/node_modules/umd/node_modules/ruglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js
npm ERR! fstream_path /media/tzookb/dynamic/www/meeters/node_modules/gulp-browserify/node_modules/browserify/node_modules/umd/node_modules/ruglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /media/tzookb/dynamic/www/meeters/npm-debug.log
npm ERR! not ok code 0
Which version of node are you running? The kind of error that you are having normally show up when you are trying to install newer modules on an older version of node.
1 - rm -rf node_modules
2 - update node to the latest version
2.1 - sudo npm cache clean -f
2.2 - sudo npm install -g n
2.3 - sudo n stable
3 - try to install gulp-browsify again
I have encountered following error while trying install mongoose.
npm http GET https://registry.npmjs.org/mongoose
npm http 200 https://registry.npmjs.org/mongoose
npm http GET https://registry.npmjs.org/mongoose/-/mongoose-3.6.0rc0.tgz
npm http 200 https://registry.npmjs.org/mongoose/-/mongoose-3.6.0rc0.tgz
npm http GET https://registry.npmjs.org/hooks/0.2.1
npm http GET https://registry.npmjs.org/mongodb/1.2.11
npm http GET https://registry.npmjs.org/ms/0.1.0
npm http GET https://registry.npmjs.org/sliced/0.0.3
npm http GET https://registry.npmjs.org/muri/0.3.0
npm http GET https://registry.npmjs.org/mpromise/0.2.0
npm http GET https://registry.npmjs.org/mpath/0.1.1
npm http 200 https://registry.npmjs.org/ms/0.1.0
npm http GET https://registry.npmjs.org/ms/-/ms-0.1.0.tgz
npm http 200 https://registry.npmjs.org/sliced/0.0.3
npm http 200 https://registry.npmjs.org/hooks/0.2.1
npm http 200 https://registry.npmjs.org/muri/0.3.0
npm http GET https://registry.npmjs.org/sliced/-/sliced-0.0.3.tgz
npm http GET https://registry.npmjs.org/hooks/-/hooks-0.2.1.tgz
npm http GET https://registry.npmjs.org/muri/-/muri-0.3.0.tgz
npm http 200 https://registry.npmjs.org/ms/-/ms-0.1.0.tgz
npm http 200 https://registry.npmjs.org/mpromise/0.2.0
npm http GET https://registry.npmjs.org/mpromise/-/mpromise-0.2.0.tgz
npm http 200 https://registry.npmjs.org/mongodb/1.2.11
npm http 200 https://registry.npmjs.org/mpath/0.1.1
npm http GET https://registry.npmjs.org/mongodb/-/mongodb-1.2.11.tgz
npm http 200 https://registry.npmjs.org/hooks/-/hooks-0.2.1.tgz
npm http GET https://registry.npmjs.org/mpath/-/mpath-0.1.1.tgz
npm http 200 https://registry.npmjs.org/muri/-/muri-0.3.0.tgz
npm http 200 https://registry.npmjs.org/mpromise/-/mpromise-0.2.0.tgz
npm http 200 https://registry.npmjs.org/mongodb/-/mongodb-1.2.11.tgz
npm http 200 https://registry.npmjs.org/mpath/-/mpath-0.1.1.tgz
npm http 200 https://registry.npmjs.org/sliced/-/sliced-0.0.3.tgz
npm ERR! error installing mongoose#3.6.0rc0
npm ERR! error rolling back mongoose#3.6.0rc0 Error: UNKNOWN, unknown error '/home/vlad/node_modules/mongoose'
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: mongodb#1.2.11
npm ERR! Required: {"node":">=0.6.19"}
npm ERR! Actual: {"npm":"1.1.0-3","node":"0.6.9"}
npm ERR!
npm ERR! System Linux 3.2.0-4-486
npm ERR! command "node" "/usr/local/bin/npm" "install" "mongoose"
npm ERR! cwd /home/vlad
npm ERR! node -v v0.6.9
npm ERR! npm -v 1.1.0-3
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm http GET https://registry.npmjs.org/sliced/0.0.4
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/vlad/npm-debug.log
npm not ok
Can someone suggest me how I can solve it?
The error tells you what the problem is:
npm ERR! Not compatible with your version of node/npm: mongodb#1.2.11
npm ERR! Required: {"node":">=0.6.19"}
npm ERR! Actual: {"npm":"1.1.0-3","node":"0.6.9"}
You have a version 0.6.9 of node installed, but the dependency package mongodb requires a version greater or equal to 0.6.19. You can upgrade by doing:
sudo npm install n -g
I tried installing derbyjs and I got the following error:
alex#alex-K43U:~/derby$ npm install -g derby
npm http GET https://registry.npmjs.org/derby
npm http 200 https://registry.npmjs.org/derby
npm http GET https://registry.npmjs.org/derby/-/derby-0.3.13.tgz
npm http 200 https://registry.npmjs.org/derby/-/derby-0.3.13.tgz
npm http GET https://registry.npmjs.org/dom-shim
npm http GET https://registry.npmjs.org/html-util
npm http GET https://registry.npmjs.org/tracks
npm http GET https://registry.npmjs.org/racer/0.3.13
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/less
npm http GET https://registry.npmjs.org/up
npm http GET https://registry.npmjs.org/stylus
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/nib
npm http 200 https://registry.npmjs.org/dom-shim
npm http GET https://registry.npmjs.org/dom-shim/-/dom-shim-0.1.1.tgz
npm http 200 https://registry.npmjs.org/tracks
npm http GET https://registry.npmjs.org/tracks/-/tracks-0.1.8.tgz
npm http 200 https://registry.npmjs.org/html-util
npm http GET https://registry.npmjs.org/html-util/-/html-util-0.1.3.tgz
npm http 200 https://registry.npmjs.org/racer/0.3.13
npm http 200 https://registry.npmjs.org/chokidar
npm ERR! error installing derby#0.3.13
npm http GET https://registry.npmjs.org/racer/-/racer-0.3.13.tgz
npm ERR! Error: No compatible version found: chokidar#'>=0.2.6'
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/home/alex/nvm/v0.6.7/lib/node_modules/npm/lib/cache.js:488:10)
npm ERR! at next_ (/home/alex/nvm/v0.6.7/lib/node_modules/npm/lib/cache.js:438:17)
npm ERR! at next (/home/alex/nvm/v0.6.7/lib/node_modules/npm/lib/cache.js:415:44)
npm ERR! at /home/alex/nvm/v0.6.7/lib/node_modules/npm/lib/cache.js:408:5
npm ERR! at saved (/home/alex/nvm/v0.6.7/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/home/alex/nvm/v0.6.7/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:231:7)
npm ERR! 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!
npm ERR! System Linux 3.0.0-24-generic
npm ERR! command "node" "/home/alex/nvm/v0.6.7/bin/npm" "install" "-g" "derby"
npm ERR! cwd /home/alex/derby
npm ERR! node -v v0.6.7
npm ERR! npm -v 1.1.0-3
npm ERR! message No compatible version found: chokidar#'>=0.2.6'
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/alex/derby/npm-debug.log
npm not ok
I have no idea how to fix this. Any suggestions?
Looking at chokidar's package.json file for versions >=0.2.6 tells me that it requires node.js version 0.6.10 or newer. You are trying to install it for node 0.6.7.
Furthermore I'd suggest using Derby with node 0.8.x. At least I have had no installation issues with Derby on node 0.8.x.
I've installed NodeJs and tried to install Socket.io
Socket.io installation fails consecutively. I've tried several differend NodeJS versions (0.6.15,0.6.16,0.6.17,0.7.8). All fail to install socket.io.
The full log can be found on pastebin.
Console log is:
C:\Program Files (x86)\nodejs>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/socket.io-client/0.9.6
npm http GET https://registry.npmjs.org/redis/0.6.7
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.6
npm http 304 https://registry.npmjs.org/redis/0.6.7
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/options
> ws#0.4.14 install C:\Program Files (x86)\nodejs\node_modules\socket.io\node_mo
dules\socket.io-client\node_modules\ws
> node install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm http 200 https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm ERR! ws#0.4.14 install: `node install.js`
npm ERR! `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the ws#0.4.14 install script.
npm ERR! This is most likely a problem with the ws package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls ws
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Program Files (x86)\nodejs
npm ERR! node -v v0.7.8
npm ERR! npm -v 1.1.18
npm ERR! code ELIFECYCLE
npm ERR! message ws#0.4.14 install: `node install.js`
npm ERR! message `cmd "/c" "node install.js"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Program Files (x86)\nodejs\npm-debug.log
npm not ok
Is there a workaround? How can I install Socket.IO on Windows 7 x64?
(Works for me with 0.6.15, win7 x64)
I'm not sure how you installed node, but it seems like you don't have it in your path.
Try editing your PATH variable and add C:\Program Files (x86)\nodejs\
Also, why are you installing in Program Files. This should be installed in your project folder. If you want to install a package globally you should use npm -g, but socket.io is not meant to be installed globally.
Problem solved on Node.js v0.8.3