Pergunta

I'm on a Mac running OSX 10.8.2. I'm learning Node.js and want to do requests using socks.

In the Terminal I used

git clone https://github.com/mattcg/socks5-http-client.git

to get the socks5 http client source.

In the downloaded source folder is an example called example-tor, so I ran

node example-tor.js

This gives me a message saying "Cannot find module 'socks5-client'".

This error is being thrown in a js file in the source folder called agent.js on a line that says var socksClient = require('socks5-client');

What am I doing wrong?

To be honest, I am just beginning Node.js. I'm not sure if I fully understand how modules work, where they are located on my Mac and how Node.js is supposed to know where they are.

I have been running through the documentation, "hello world" tutorials and tutorials to install things like "npm" package manager but the whole process of getting something working seems very messy and unclear.

Hope someone can point me in the right direction.

Foi útil?

Solução

Try running npm install from the terminal in the socks5-http-client top folder (the same one with the package.json file)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top