express.io icon indicating copy to clipboard operation
express.io copied to clipboard

cannot find module

Open belldandu opened this issue 9 years ago • 9 comments

command i run to install modules sudo npm install difflib colors global-tunnel bases chance cheerio q request rethinkdbdash ws xml2js youtube-api mathjs express.io lodash -g && sudo npm link difflib colors global-tunnel bases chance cheerio q request rethinkdbdash ws xml2js youtube-api mathjs express.io lodash

Error: Cannot find module 'express/node_modules/connect'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/express.io/lib/index.coffee:4:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/express.io/lib/index.coffee:263:4)
    at Module._compile (module.js:425:26)
    at Object.require.extensions..coffee (/usr/local/lib/node_modules/express.io/node_modules/coffee-script/lib/coffee-script/coffee-script.js:30:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)

tried uninstalling and reinstalling same thing keeps happening.

belldandu avatar Nov 15 '15 22:11 belldandu

+1 I am getting the same issue

zacharynevin avatar Dec 19 '15 22:12 zacharynevin

same here

LennartRoeder avatar Jan 10 '16 18:01 LennartRoeder

Same here, is there any other thing I need to do besides turning require('express') into require('express.io') ?

Zunon avatar Jan 21 '16 16:01 Zunon

Same here, in node 5. If you check this file on the error line (/node_modules/express.io/lib/index.coffee:4:13), you see:

connect = require 'express/node_modules/connect'

What version of node you have? I have the 5 and this error happen, for example if i use an old version 0.12 and 4 works. I think is an incompatibility with the new npm flat structure in node_modules. And also if you change the line by:

connect = require 'connect'

Works!But I dont think is the best solution

danibram avatar Feb 02 '16 15:02 danibram

+1 Also having this issue with Node.js 5. Is express.io still maintained?

pmb0 avatar Feb 13 '16 10:02 pmb0

Is express.io still maintained? It would be great to fix this issue. Thanks!

jan-rus avatar Feb 15 '16 08:02 jan-rus

Here's what I added to solve similar issues

npm install coffee-script -D;
npm install connect -D;

One can read npm-debug.log on the root directory of your project to see the error messages, and solve them one by one. I hope it helps.

ldong avatar Feb 15 '16 18:02 ldong

npm --save -d install express.io npm --save -d install coffee-script npm --save -d install connect

gets it working on npm (v3.9.0) and node (v0.10.42)

package.json turns out to be like this

...
  "dependencies": {
    "coffee-script": "^1.10.0",
    "connect": "^3.4.1",
    "express.io": "^1.1.13"
  }
...

Hope that helps, although it'd be better if express.io updates this in the next release (?)

visitsb avatar May 10 '16 02:05 visitsb

Unfortunately even after installing connect and coffee-script the server wont run and I still get these Errors of missing required stacks.

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'express/node_modules/connect'
Require stack:
- C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\node_modules\express.io\lib\index.coffee
- C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\node_modules\express.io\switch.js
- C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\dist\core\framework\Express.js
- C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\dist\core\Singleton\Singleton.js
- C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\dist\Server.js    
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\node_modules\express.io\lib\index.coffee:4:13)
    at Object.<anonymous> (C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\node_modules\express.io\lib\index.coffee:263:4)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.require.extensions..coffee (C:\Users\apuns\Desktop\Courses\Node Complete Guide\project\AbdullahKhdir\node_modules\express.io\node_modules\coffee-script\lib\coffee-script\coffee-script.js:30:21)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\apuns\\Desktop\\Courses\\Node Complete Guide\\project\\AbdullahKhdir\\node_modules\\express.io\\lib\\index.coffee',
    'C:\\Users\\apuns\\Desktop\\Courses\\Node Complete Guide\\project\\AbdullahKhdir\\node_modules\\express.io\\switch.js',
    'C:\\Users\\apuns\\Desktop\\Courses\\Node Complete Guide\\project\\AbdullahKhdir\\dist\\core\\framework\\Express.js',
    'C:\\Users\\apuns\\Desktop\\Courses\\Node Complete Guide\\project\\AbdullahKhdir\\dist\\core\\Singleton\\Singleton.js',
    'C:\\Users\\apuns\\Desktop\\Courses\\Node Complete Guide\\project\\AbdullahKhdir\\dist\\Server.js'
  ]
}
[nodemon] app crashed - waiting for file changes before starting...

AbdullahKhdir avatar Nov 17 '22 10:11 AbdullahKhdir