1

Here is the error which I get when I run nodejs app.js

module.js:340
throw err;
      ^
Error: Cannot find module 'share'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/quicksilver/project/master/app.js:3:17)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

I am repeatedly getting this error : I have already done npm install -g share several times ,but it has been no use.

var express = require('express')
var sharejs = require('share')
var connect = require('connect')
var AWS = require('aws-sdk');

//var zmq = require('zmq');
var app = express();
app.set('view options', {layout: false});
var problem={};
var sharejs_server;
AWS.config.loadFromPath('./awsconfig.json');

locomotive.boot('.', app.settings.env, function(err, app) {
var options = {};
if (err) { throw err; }
options.db = app.locals.db;
sharejs_server = sharejs.server.attach(app, options);
app.listen(app.locals.port, app.locals.ip, function () {
     var addr = this.address();
     console.log('listening on %s:%d', addr.address, addr.port);
}); 
});
  • From the [readme for share on npm](https://npmjs.org/package/share): "Welcome. So you know, this code might spontaneously catch fire". – Jay Jan 26 '14 at 18:54
  • @TrevorSenior: I don't know about the code,but I want to bang my head against the wall. – user3238156 Jan 26 '14 at 19:01
  • Maybe try an older version. They say it's become more unstable over time. – Jay Jan 26 '14 at 19:07
  • have you tried the npm link command? i think some globals can't be accessed – Theofilos Mouratidis Jan 26 '14 at 20:10
  • Why are you using `-g`? Just `npm install share` should be sufficient. Global installations are in general a bad idea for anything except installing utility applications. – qubyte Jan 27 '14 at 00:49
  • possible duplicate of [Error: Cannot find module 'ejs'](http://stackoverflow.com/questions/7754799/error-cannot-find-module-ejs) – Paul Sweatte May 01 '15 at 03:29

0 Answers0