Git Product home page Git Product logo

Comments (7)

rvagg avatar rvagg commented on May 22, 2024

looks like you might have a stale process running in the background, try killall node and try again. Also sudo npm install learnyounode -g to get the latest, I just published a new version that has an auto-kill thing in it that should (hopefully) stop this kind of thing.

from learnyounode.

jonniedarko avatar jonniedarko commented on May 22, 2024

I have no other node processes running and I rerun the npm install learnyounode -g and tried again, still with no success. Running in windows 7 if that makes any difference

from learnyounode.

jonniedarko avatar jonniedarko commented on May 22, 2024

I also seem to have the same Issue with the Juggling-async solution

from learnyounode.

jonniedarko avatar jonniedarko commented on May 22, 2024

I Think it may be an issue with the network proxy as I had the same issue running the following myself

http.get('http://www.google.com/index.html', function(res) {
  console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
  console.log("Got error: " + e.message);
});

I had to change the above to the following where our company proxy is http://http.proxy.somewhere.com:1234:

http.get({ host: 'http.proxy.somewhere.com', path:'http://www.google.com/index.html', port: 1234}, function(res) {

  console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
  console.log("Got error: " + e.message);
});

I realise this is probably not a bug, at least not with learnyounode (possibly more so with Node itself) but how might I get around it

from learnyounode.

Flet avatar Flet commented on May 22, 2024

Hi @jonniedarko,

It would not be a proxy issue as its not calling out anywhere when verifying.

The solution.js requires the npm module bl, which may not have been installed. When I try to run the solution without first installing bl, I get the same failure you describe above. After I install it, great success!

Try npm install bl in the same directory and verify again. This step is described nicely in the problem description for http collect.

You may run into issues with npm if you're behind a proxy. Run this command to set the proxy for npm:
npm config set proxy http://username:[email protected]:80

from learnyounode.

jonniedarko avatar jonniedarko commented on May 22, 2024

Hi @Flet , looks like that was the Issue, I was pretty sure that I had installed bl globally thought, so not sure why that didn't work but I tried it with a local install and it solved my problem

from learnyounode.

chiadt avatar chiadt commented on May 22, 2024

You try:

var http = require('http')
var bl = require('bl')

http.get(process.argv[2], function (response) {
  response.pipe(bl(function (err, data) {
    if (err)
      return console.error(err)
    data = data.toString()
    console.log(data.length)
    console.log(data)
  }))  
})

from learnyounode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.