Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'now' #226

Open
ghost opened this issue Mar 7, 2017 · 0 comments
Open

Error: Cannot find module 'now' #226

ghost opened this issue Mar 7, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 7, 2017

Hi All,

after searching and reading dozen of articles about this error, it still is there!!

I've tried everything i found on this matter, npm install now, npm install now -g, from package.json etc etc. I use http as well, without problems. Here's my code, perhaps i'm missing something.

  • The folder 'now' exists in 'node_modules'
  • Properly installed 'now' the way i installed the other modules

This is the full error while running 'Node server.js':

Error: Cannot find module 'now'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/mmorpg/public_html/server.js:10:13)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

This is server.js:

var httpServer = require('http').createServer(function(req, response) {
    response.end('Wokring http server.');
});

httpServer.listen(1337);

console.log('Server running on port: 1337');

var nowjs = require('now');
var everyone = nowjs.initialize(httpServer);

everyone.now.logStuff = function(msg){
    console.log(msg);
}

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants