Compatibility with npm v3.0.0: Cannot find module #462

Closed
shirish87 opened this Issue Jun 27, 2015 · 6 comments

Projects

None yet

5 participants

@shirish87

Low priority since npm@3 is still in beta.

Code in middleware.js attempts to reuse the send module from the connect module. But because the new version of npm now has a flat structure for modules, relative paths referencing node_modules fail.

npm is now smart enough to handle duplicate dependencies, so we should just include send as a dependency and it'll dedup.

$ harp init react-dashboard
module.js:338
    throw err;
          ^
Error: Cannot find module '../node_modules/connect/node_modules/send'
  at Function.Module._resolveFilename (module.js:336:15)
  at Function.Module._load (module.js:278:25)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/home/shirish/.nvm/v0.12.4/lib/node_modules/harp/lib/middleware.js:10:12)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/home/shirish/.nvm/v0.12.4/lib/node_modules/harp/lib/index.js:8:19)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/home/shirish/.nvm/v0.12.4/lib/node_modules/harp/bin/harp:9:21)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Function.Module.runMain (module.js:501:10)
  at startup (node.js:129:16)
  at node.js:814:3
@othiym23

npm@3 is no longer in beta. :D

Leaving this note here because npm's own documentation site relies on harp and it can't be used with the current stable version of npm, which seems at least mildly problematic. Is there a downside of having harp depend directly on send?

@kennethormandy
Collaborator

Hey @othiym23! Congrats on the launch. I actually just updated Connect and fixed this yesterday on the release-v0.18.1 branch, we should be tagging a new release of Harp tomorrow—all tests are passing on Node v4.1.0 and npm@3.3.3.

@sintaxi
Owner
sintaxi commented Sep 18, 2015

Resolved! Thanks @othiym23. Great work on getting npm 3 launched.

@sintaxi sintaxi closed this Sep 18, 2015
@benburton

Hey @othiym23! Congrats on the launch. I actually just updated Connect and fixed this yesterday on the release-v0.18.1 branch, we should be tagging a new release of Harp tomorrow—all tests are passing on Node v4.1.0 and npm@3.3.3

Any chance that new release will be cut soon?

@kennethormandy
Collaborator

@benburton Hey, we’ve published a couple of version since then. The latest is v0.20.x, which works with Node v5 and npm@3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment