Skip to content

Instantly share code, notes, and snippets.

@drd
Created October 10, 2014 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drd/70479b2b5cff73687451 to your computer and use it in GitHub Desktop.
Save drd/70479b2b5cff73687451 to your computer and use it in GitHub Desktop.
Help me figure out why the path of the bundle affects npm module resolution?
# browserifying a bundle from the exact same working directory but where the
# target is elsewhere (the package i'm trying to build for release)
# fails to find the reactify module;
[eric@lxc000 app-ido-i3 (develop *)]$ bash -c "source develop; /Users/eric/work/app-ido-i3/front-end/blue-1/../../node_modules/.bin/browserify -t reactify /idealist/releases/permastatic-v0.0/resource/blue-1/js/abc.bundle.jsx"
Ready.
Error: Cannot find module 'reactify' from '/idealist/releases/permastatic-v0.0/resource/blue-1/js'
at /Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:50:17
at process (/Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:119:43)
at /Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:128:21
at load (/Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:60:43)
at /Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:66:22
at /Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:21:47
at Object.oncomplete (fs.js:107:15)
# browserifying a bundle inside the same directory as my development environment works
bash -c "source develop; /Users/eric/work/app-ido-i3/front-end/blue-1/../../node_modules/.bin/browserify -t reactify front-end/shared/js/abc.bundle.jsx"
... happy browserify output ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment