Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browserify fails to build #52

Open
KevinWMatthews opened this issue Nov 28, 2019 · 1 comment
Open

Browserify fails to build #52

KevinWMatthews opened this issue Nov 28, 2019 · 1 comment

Comments

@KevinWMatthews
Copy link

Hi,

I'm new to node and am trying to build cowsay in the browser using browserify. I'm encountering this error:

$ browserify clientCowsay.js -o bundle.js
Error: Cannot find module '.cows/ackbar.cow' from  '/my/dev/dir/node_modules/cowsay/build'

I've installed browserify to system, cowsay locally, and am using this JavaScript:

// clientCowsay.js
const cowsay = require('cowsay');
console.log(cowsay.say({text: "You don't say!"}));

Am I making a mistake or is there something out of sorts with the package?

Thanks!

@piuccio
Copy link
Owner

piuccio commented Dec 19, 2019

Browser support was added a while back in #26 I don't know if things have changed since then, but browserify should use the browser field in package.json. It looks like it's using the main instead. Is there any configuration in browserify to instruct on how to resolve modules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants