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

Cannot browserify jsonlint: module "file" missing #57

Open
josdejong opened this issue Mar 12, 2015 · 6 comments · May be fixed by #68
Open

Cannot browserify jsonlint: module "file" missing #57

josdejong opened this issue Mar 12, 2015 · 6 comments · May be fixed by #68

Comments

@josdejong
Copy link

Thanks for offering jsonlint via npm, works great.

I stumbled upon one issue though: when I try to browserify jsonlint, an error is thrown:

Error: Cannot find module 'file' from '/home/ubuntu/workspace/node_modules/jsonlint/lib'

The module file is required here in the source code:
https://github.com/zaach/jsonlint/blob/master/lib/jsonlint.js#L424

It looks like the "file" module is missing from the dependencies in package.json. But maybe this code is redundant anyway: I guess if you're not running node.js (i.e. typeof process === 'undefined'), the file module won't work either?

@gillesdemey
Copy link

+1

@XVincentX
Copy link

+1, we're having the same issue with webpack.

@josdejong
Copy link
Author

For a workaround: I've cloned the project and fixed this issue here:

https://github.com/josdejong/jsonlint

@XVincentX
Copy link

Cool! Did you issue a PR for that?

@josdejong
Copy link
Author

no, see #56.

kvz added a commit to kvz/lanyon that referenced this issue Dec 7, 2016
@prantlf
Copy link

prantlf commented May 19, 2019

Can this error be forced to be ignored in browserify? The main method is usually not to be imported. Exports parser and Parser are usually used in web applications.

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

Successfully merging a pull request may close this issue.

4 participants