Reputation: 7799
I'm trying to build my project using browserify, (the local binary from node_modules/.bin/
)
this is the complete command
./node_modules/.bin/browserify . | uglifyjs -cm >js/bundle.min.js
my directory is /var/www/react-shopping
I do not understand this error, Error: Cannot find module '/var/www/react-shopping'
Complete error here,
Error: Cannot find module '/var/www/react-shopping' from '/var/www/react-shopping'
at /var/www/react-shopping/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
at load (/var/www/react-shopping/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
at onex (/var/www/react-shopping/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
at /var/www/react-shopping/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:95:15)
Upvotes: 1
Views: 1177
Reputation: 3149
try this:
browserify index.js | uglifyjs -cm > js/bundle.min.js
where index.js
is the entry point of your application.
browserify
should be installed with:
npm install --save-dev browserify
and uglifyjs
with:
npm install --save-dev uglifyify
Take a look at this for more information
Upvotes: 1