Get Even More Visitors To Your Blog, Upgrade To A Business Listing >> not found on Ubuntu but is on Windows not found on Ubuntu but is on Windows


I've been pulling out my hair trying to figure this problem out. I have a node.js app that works fine in windows. I zipped everything up and put it on my linux box (Ubuntu 12) and installed all of the libraries through npm, and yet I still get a 404 message saying my file cannot be found. I've tried various solutions such as linked to the script but that just throws a "require not found" error. My code in my html is as follows:

I've even tried

and here is my server side:

var express = require('express');
var app = express.createServer();
var io = require('').listen(app);
console.log('server started');

This question is similar, however the answer for it is simply is an updated express semantic which shouldn't apply to my code: not found

If my understanding is correct, the script path should work because when is running, it should direct that request to the right route. I don't really know what else I should look into for a fix, could it be something with the path in Ubuntu? Any help would be very much appreciated!

Just tested this:

var io = require('').listen(8000);

Went to localhost:8000 and the 'welcome to' message showed up so I know it is running....

node_modules: /home/alex/node_modules/
my node app: /home/alex/documents/project/app.js

Problem courtesy of: Alex Roe


I had the same problem and it seemed that the reason was that something went wrong during the installation of Actually the only workaround I found was to make a new directory, copy all your code there and do a fresh install of the Express and modules:
npm install express
Maybe I was lucky, but it worked!

Solution courtesy of: Flolagale


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post not found on Ubuntu but is on Windows


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription