I'm working on a real time application and I'm using third party to do it. But now I have to use node.js with socket.io instead of third party .
I installed the node.js (v0.4.12) correctly and I check it using command node -v
.
but when I was installed the socket.io using npm install socket.io
command I got this error .
npm ERR! install failed Error: Required package: options(latest) not found. (Found: ["0.0.3"])
npm ERR! install failed (required by: [email protected])
npm ERR! install failed at /usr/share/npm/lib/build.js:192:19
npm ERR! install failed at cb (/usr/share/npm/lib/utils/graceful-fs.js:32:9)
npm ERR! Error: Required package: options(latest) not found. (Found: ["0.0.3"])
npm ERR! (required by: [email protected])
npm ERR! at /usr/share/npm/lib/build.js:192:19
npm ERR! at cb (/usr/share/npm/lib/utils/graceful-fs.js:32:9)
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <[email protected]>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok
How I can solve it?
I ran those commands and it worked:
sudo npm install -g n
sudo n 0.8.15
sudo npm install socket.io
You're trying to install it without a package.json file, and in your solution you installed it globally, which is usually not what you want for socket.io.
Instead, you should include a package.json file in your working directory and either run:
> npm install socket.io --save
which will automatically append it to package.json, or your you can physically include it in the dependencies and then just run:
> npm install
It worked:
1) sudo npm install -g n
2) sudo n 0.8.15
3) sudo npm install socket.io
In some cases if you are behind a proxy and try to run:
sudo npm install socket.io
you may end up in getting error -
npm ERR! Error: shasum check failed for /tmp/npm-1393245157089/1393245157089-0.6057841922156513/tmp.tgz npm ERR! Expected: 3bab0444e49b55fbbc157424dbd41aa375a51a76 npm ERR! Actual: dae95023b71f7d06533f7c35a7d0c3b0cf729f42
then run the following
sudo npm --proxy=http://"your_proxy":"your_port" install socket.io
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With