Error while installing express - node.js

Saw following error while installing express.
I am using node 0.10.17
and npm 1.3.8
I tried npm install express
It looks like version issue. Which version is recommended?
npm ERR! Error: shasum check failed for C:\Users\GAURAV~1\AppData\Local\Temp\npm
-5800-RRPyptXX\1384367930969-0.5868753655813634\tmp.tgz
npm ERR! Expected: a567c2af000ad22dc8f2a653d91978ae1f5316f4
npm ERR! Actual: 4077b08504e56e904990e4cc29e248752fbf211f
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\sha\index.
js:38:8
npm ERR! at ReadStream.<anonymous> (C:\Program Files\nodejs\node_modules\npm
\node_modules\sha\index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
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\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
npm ERR! cwd D:\Project\websocket
npm ERR! node -v v0.10.17
npm ERR! npm -v 1.3.8
npm http GET https://registry.npmjs.org/bytes/0.2.1
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/uid2/0.0.3
npm http 304 https://registry.npmjs.org/bytes/0.2.1
npm http 304 https://registry.npmjs.org/uid2/0.0.3
npm http 304 https://registry.npmjs.org/mime
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\Project\websocket\npm-debug.log
npm ERR! not ok code 0
Any solution?

The npmjs.org web site has been having reliability problems both last week and today. As Jeremy commented, this is probably just npm being unable to get the express package downloaded correctly. Wait a while for them to get it up and running again then retry.

Sounds like an npm issue, try a mirror:
npm [command] --registry http://npm.nodejs.org.au:5984/registry/_design/app/_rewrite

Related

while installing webdriverio node unable to find dependencies

While installing the module webdriverio using npm, I am getting the following error:
sudo npm install webdriverio
[sudo] password for username:
npm WARN package.json indexof#0.0.1 No repository field.
npm http GET https://registry.npmjs.org/webdriverio
npm http 304 https://registry.npmjs.org/webdriverio
npm WARN engine webdriverio#5.4.9: wanted: {"node":">= 4.8.5"} (current: {"node":"v0.10.15","npm":"1.3.5"})
npm http GET https://registry.npmjs.org/grapheme-splitter
npm http GET https://registry.npmjs.org/css-value
npm http GET https://registry.npmjs.org/lodash.merge
npm http GET https://registry.npmjs.org/lodash.zip
npm http GET https://registry.npmjs.org/rgb2hex
npm http GET https://registry.npmjs.org/serialize-error
npm http GET https://registry.npmjs.org/webdriver
npm http GET https://registry.npmjs.org/wdio/logger
npm http GET https://registry.npmjs.org/wdio/config
npm http GET https://registry.npmjs.org/wdio/repl
npm http 304 https://registry.npmjs.org/css-value
npm ERR! Error: No compatible version found: css-value#'^0.0.1'
npm ERR! Valid install targets:
npm ERR! ["0.0.1"]
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/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 Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm http 304 https://registry.npmjs.org/lodash.merge
npm http 304 https://registry.npmjs.org/serialize-error
npm http 304 https://registry.npmjs.org/lodash.zip
npm http 304 https://registry.npmjs.org/grapheme-splitter
npm http 304 https://registry.npmjs.org/webdriver
npm http 304 https://registry.npmjs.org/rgb2hex
npm http 405 https://registry.npmjs.org/wdio/repl
npm ERR! TypeError: Object.keys called on non-object
npm ERR! at Function.keys (native)
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/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 Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! type called_on_non_object
npm http 405 https://registry.npmjs.org/wdio/logger
npm ERR! TypeError: Object.keys called on non-object
npm ERR! at Function.keys (native)
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/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 Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! type called_on_non_object
npm http 405 https://registry.npmjs.org/wdio/config
npm ERR! TypeError: Object.keys called on non-object
npm ERR! at Function.keys (native)
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:708:24)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/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 Linux 4.15.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webdriverio"
npm ERR! cwd /home/username/research
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! type called_on_non_object
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/username/research/npm-debug.log
npm ERR! not ok code 0
Could someone please help with this? I do not understand why this is happening since when I do npm info loadash.merge, the module version is clearly present. I have also tried to see what my $NODE_PATH contains (as some answers on stackoverflow suggest), and it seems to be pointing towards the correct path of node, or at least the path where nvm installed node:
/home/username/.nvm/versions/node/v10.15.1/bin/node
Additionally, I am not sure about this particular warning:
npm WARN engine webdriverio#5.4.9: wanted: {"node":">= 4.8.5"} (current: {"node":"v0.10.15","npm":"1.3.5"}) My node version is 10.15.1 and not 0.10.15
I think you're missing the css-value library based on this part of the stack trace:
npm ERR! Error: No compatible version found: css-value#'^0.0.1'
Try to resolve this by doing: npm i css-value
Additionally, your stack trace is complaining about using an outdated version of Node. I would consider updating node since your version is very old:
npm WARN engine webdriverio#5.4.9: wanted: {"node":">= 4.8.5"} (current: {"node":"v0.10.15","npm":"1.3.5"})
Your issue is probably with using sudo in the npm install. You can check this out by using sudo node -v and it will probably give you a different node version than your nvm installed one, this would indicate that node in your server is broken in some places due some previous installation. To circumvent it I suggest the following that has worked for me for similar issues.
sudo su
nvm alias default 10.15.1
npm cache clean --force
npm install webdriverio
If it still gives syntax errors due to dependencies, use
npm install webdriverio --unsafe-perm

npm install doesn't work due to unavailable version

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).

Error installing nodejs ari-client library

I am trying to install ari-client,using this command:
sudo npm install ari-client
Here is the error I get:
npm http GET http://registry.npmjs.org/ari-client
npm http 304 http://registry.npmjs.org/ari-client
npm http GET http://registry.npmjs.org/swagger-client/2.0.26
npm http GET http://registry.npmjs.org/ws/0.4.31
npm http GET http://registry.npmjs.org/underscore/1.6.0
npm http GET https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz
npm http 400 https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz
npm ERR! Error: 400 Bad Request
npm ERR! at WriteStream.<anonymous> (/usr/share/npm/lib/utils/fetch.js:57:12)
npm ERR! at WriteStream.EventEmitter.emit (events.js:117:20)
npm ERR! at fs.js:1601: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 /home/bzegeju/npm-debug.log npm
npm ERR! System Linux 3.11.0-26-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "ari-client"
npm ERR! cwd /home/bzegeju
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm http 304 http://registry.npmjs.org/ws/0.4.31
npm http 304 http://registry.npmjs.org/underscore/1.6.0
npm http 304 http://registry.npmjs.org/swagger-client/2.0.26
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/bzegeju/npm-debug.log
npm ERR! not ok code 0
Any help on the error or how I can manually install the library?
For Manual installation:
1.Go to npm site search for "ari-client".
2.Click the given "github" link , from there you can download as ZIP file.
3.Extract it and use in your project

Error on Installing mobify-client

I got this error while trying to install mobify client. My node.js version is: 0.8.6 and npm: 1.1.48. Also I am behind a proxy and in first row I just set proxy but I dont know is this act as same as setting http_proxy variable?
C:\Users\user>npm config set proxy http://user:pass#proxy:port
C:\Users\user>npm -g install mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm ERR! at ClientRequest.<anonymous> (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\request\main.js:440:26)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR! at HTTPParser.parserOnIncomingClient (http.js:1455:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR! at CleartextStream.socketOnData (http.js:1366:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:485:27)
npm ERR! at SecurePair.cycle (tls.js:839:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:220:13)
npm ERR! at Socket.ondata (stream.js:38:26)
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 (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install" "mobify-client"
npm ERR! cwd C:\Users\user
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\user\npm-debug.log
npm ERR! not ok code 0
It seems like there could have been two potential issues here. One is that the npm server may have had some issues at the time, you might want to try again now and see if you get the same error. The same question was asked in our Support forums (may even have been asked by you :) ) and another user said that trying again later fixed the issue:
https://support.mobify.com/customer/portal/questions/445465-installation-error
Another issue is that you may be behind a proxy and can't connect to the npm server. You can set the proxy location using this command:
npm config set proxy http://url:port
Or if the proxy is authenticated:
npm config set proxy http://user:pass#url:port

Installing node-inspector on Windows

When I run npm install node-inspector, I get the following:
....
GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.8
npm http 304 https://registry.npmjs.org/redis/0.7.2
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/hiredis
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/xmlhttprequest/1.2.2
npm http GET https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/hiredis
> hiredis#0.1.14 preinstall C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\redis\node_modules\hiredis
> make || gmake
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2
'make' is not recognized as an internal or external command,
operable program or batch file.
'gmake' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! error installing hiredis#0.1.14
npm ERR! error installing redis#0.7.2
npm ERR! error installing socket.io#0.9.8
npm ERR! error rolling back socket.io#0.9.8 Error: UNKNOWN, unknown error 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client'
npm ERR! error installing node-inspector#0.2.0beta3
npm ERR! Error: ENOENT, no such file or directory 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\p
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 Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files (x86)\\nodejs\\\\node.exe" "c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-inspector"
npm ERR! cwd C:\apache\expTest
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! path C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\package\lib\Validation.fallback.js
npm ERR! fstream_path C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\package\lib\Validation.fallbac
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.io-client\node_modules\___ws.npm\
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (c:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:204:26)
npm ERR! error rolling back node-inspector#0.2.0beta3 Error: UNKNOWN, unknown error 'C:\apache\expTest\node_modules\node-inspector\node_modules\socket.io\node_modules\socket.
npm ERR! hiredis#0.1.14 preinstall: `make || gmake`
npm ERR! `cmd "/c" "make || gmake"` failed with 1
npm ERR!
npm ERR! Failed at the hiredis#0.1.14 preinstall script.
npm ERR! This is most likely a problem with the hiredis package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make || gmake
npm ERR! You can get their info via:
npm ERR! npm owner ls hiredis
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 Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-inspector"
npm ERR! cwd C:\apache\expTest
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! code ELIFECYCLE
npm ERR! message hiredis#0.1.14 preinstall: `make || gmake`
npm ERR! message `cmd "/c" "make || gmake"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\apache\expTest\npm-debug.log
npm not ok
It looks like it is trying to run a nix command at hiredis, which fails, crashing the entire install. Is there any way to get around this? I have heard plenty of Windows users using node-inspector, but perhaps this is a dependency from a newer version. Any ideas?
As M. Laing said, you're missing GNU make, which is required by hiredis (a redis connector).
You don't need redis for node-inspector, but it's required by socket.io, even though it's for a completely optional feature. I've opened an issue on github about that:
https://github.com/LearnBoost/socket.io/issues/978
While this gets resolved, here's a work around:
Download socket.io's ZIP archive from github and unzip it.
Edit the package.json file and remove redis from the dependencies.
Run a cmd, enter the folder and type npm install.
Type npm install node-inspector again.
Since socket.io is now installed, it should now succeed.

Resources