2

Hi i am trying to run the nodejs script and it pops up the following error message:

enter image description here

I have installed socket.io globally using following command:

>npm install -g socket.io

but still no luck.

Any help?

6
  • Don't install it globally. Only install modules globally which you'll be using command line interfaces of, like mocha or casper. Anything you "require" in your app is installed locally. Commented Oct 23, 2014 at 5:41
  • i installed it locally first but it is not working either thats why i installed globally later Commented Oct 23, 2014 at 5:48
  • In your app folder there's a "node_modules" directory, does "socket.io" exists in it? Commented Oct 23, 2014 at 5:50
  • I can't think of any reason it shouldn't be working in that case :/. Try deleting the folder, clearing npm cache (npm cache clean) and installing it again. Also, are the other modules working fine? Commented Oct 23, 2014 at 6:01
  • Show us the require() line you use to load it. Commented Oct 23, 2014 at 6:27

1 Answer 1

5

Use it locally instead, and save to your package.json

npm install socket.io --save
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.