Module not found: Error: Can't resolve 'child_process' in...
metalllus opened this issue · 4 comments
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?
Please try above solutions and let us know the result.
@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.
@metalllus Do you know the fix? #747
No activity on this issue since February. I close it.