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

Module not found: Error: Can't resolve 'child_process' in... #742

Closed
metalllus opened this issue Feb 12, 2023 · 4 comments
Closed

Module not found: Error: Can't resolve 'child_process' in... #742

metalllus opened this issue Feb 12, 2023 · 4 comments

Comments

@metalllus
Copy link

Hi, just a quick question, when I install google-spreadsheet npm package I get these errors on compilation.

./node_modules/google-auth-library/build/src/auth/googleauth.js:21:24-48 - Error: Module not found: Error: Can't resolve 'child_process' in 'C:\Programming\ASAP_invoice_electron_angular_new\node_modules\google-auth-library\build\src\auth'

./node_modules/google-auth-library/build/src/auth/googleauth.js:22:11-24 - Error: Module not found: Error: Can't resolve 'fs' in 'C:\Programming\ASAP_invoice_electron_angular_new\node_modules\google-auth-library\build\src\auth'

./node_modules/google-p12-pem/build/src/index.js:13:11-24 - Error: Module not found: Error: Can't resolve 'fs' in 'C:\Programming\ASAP_invoice_electron_angular_new\node_modules\google-p12-pem\build\src'

./node_modules/gtoken/build/src/index.js:14:11-24 - Error: Module not found: Error: Can't resolve 'fs' in 'C:\Programming\ASAP_invoice_electron_angular_new\node_modules\gtoken\build\src'

./node_modules/https-proxy-agent/dist/agent.js:38:30-44 - Error: Module not found: Error: Can't resolve 'net' in 'C:\Programming\ASAP_invoice_electron_angular_new\node_modules\https-proxy-agent\dist'

./node_modules/https-proxy-agent/dist/agent.js:39:30-44 - Error: Module not found: Error: Can't resolve 'tls' in 'C:\Programming\ASAP_invoice_electron_angular_new\node_modules\https-proxy-agent\dist'

Any idea, how to fix this?

@thamizh-qwerty
Copy link

https://stackoverflow.com/questions/54459442/module-not-found-error-cant-resolve-child-process-how-to-fix

Please try above solutions and let us know the result.

@metalllus
Copy link
Author

@thamizh-qwerty I managed to get it working for the time being by adding "browser": {"child_process": false, etc.}" to every sub module under node_modules that requests the non-existent module. E.g. adding "browser": {"child_process": false, "fs": false}" to package.json under node_modules/google-auth-library etc. It works but this is a terrible solution since every time you delete the node_modules and do the npm install you have to do all the edits manually again. I'm sure there is a better way. If anyone knows how please let me know.

@thamizh-qwerty
Copy link

@metalllus Do you know the fix? #747

@maximegris
Copy link
Owner

No activity on this issue since February. I close it.

@maximegris maximegris closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
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

3 participants