Giter Site home page Giter Site logo

Comments (12)

dougwilson avatar dougwilson commented on April 20, 2024

Can you check if there is even a bin/www file in your directory? Can you show what the output of node -v is?

from generator.

MadaraUchiha avatar MadaraUchiha commented on April 20, 2024

bin/www is an existing file. And it runs well (like I said, the server runs successfully, it only fails after one request).

madara@Madara-PC:~/nodejs/magisite$ node -v
v0.10.25

from generator.

dougwilson avatar dougwilson commented on April 20, 2024

OK. Are you running it as ./bin/www? Can you try running it as npm start according to our readme? Would you also be able to paste the contents of bin/www into this issue?

from generator.

MadaraUchiha avatar MadaraUchiha commented on April 20, 2024

Sure. With npm start I get a slightly different error:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

The contents of the bin/www file are:

#!/usr/bin/env node
var debug = require('debug')('magisite');
var app = require('../app');

app.set('port', process.env.PORT || 3000);

var server = app.listen(app.get('port'), function() {
  debug('Express server listening on port ' + server.address().port);
});

from generator.

dougwilson avatar dougwilson commented on April 20, 2024

According to

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

you're system has an old node installed that is messing this stuff up. You'll want to make sure you are not using the nodejs debian package and instead whatever you're supposed to be using on there (sorry, I'm not familiar with it, just that installing the system package just breaks node stuff).

from generator.

dougwilson avatar dougwilson commented on April 20, 2024

You can read more about solutions that may work for you here: http://stackoverflow.com/questions/21168141/can-not-install-packages-using-node-package-manager-in-ubuntu

from generator.

MadaraUchiha avatar MadaraUchiha commented on April 20, 2024

How would you explain node -v displaying the latest version of node then...? Also, other applications work just fine for me.

from generator.

dougwilson avatar dougwilson commented on April 20, 2024

On the same reasoning, can you you explain that warning? So far everyone that has reported the spawn ENOENT has either had the issue I explained to you or just completely reinstalled all their node.js stuff and then it worked.

If you do find the solution, though, please let us know so we can better help people who encounter it.

from generator.

dougwilson avatar dougwilson commented on April 20, 2024

Can you at least just try to sudo apt-get install nodejs-legacy from the StackOverflow link and see if it fixes the issue?

from generator.

MadaraUchiha avatar MadaraUchiha commented on April 20, 2024

I have tried. As well as the symbolic link solution after that one didn't work. Nothing :(

from generator.

dougwilson avatar dougwilson commented on April 20, 2024

Gotcha. Yea, I have no idea. Everyone who has reported this has only given vague solutions, so I really don't know what the solution is, besides that it works for thousands of people per day. Maybe start by slowing stripping down the contents of app.js until it starts working, to see if there is something in there causing it?

from generator.

rlidwka avatar rlidwka commented on April 20, 2024

Just disregard npm warning, those guys want us to rename "node" to "nodejs" for no good reason.

If you want to debug it further,

which node ; ls -l `which node`

... will help a bit. Here is what my debian shows:

lrwxrwxrwx 1 root root 6 Mar 27 12:19 /usr/bin/node -> nodejs

If you want it "just work", I think node ./bin/www will do the job fine.

PS: works for me

from generator.

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.