Skip to content

Instantly share code, notes, and snippets.

@drd
Created Oct 10, 2014
Embed
What would you like to do?
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