-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Error: Can't resolve 'crypto' #1555
Comments
https://www.npmjs.com/package/crypto
Try to upgrade node-js |
I'm using node version 9.11.1 |
I have same problem ,my node version is also 9.11.1 |
I've been experiencing this too (I recently upgraded to Angular 6 rc.5). I think the problem here is with the Angular CLI and it's underlying Webpack... Previously, my CLI is at version 1.7.3 and Web3 works just fine, but after upgrading to 1.7.4 it's not working anymore and shows exactly the error mentioned above. To work this around, I just downloaded the build files from the releases page, copied the source to my |
My workaround was to downgrade to an older version of web3: |
Another workaround is the suggested here: angular/angular-cli#1548 (comment) |
Ah yes!! this solution with the patch worked:
|
@kmturley Thank you ! |
@kmturley I'm not using angular-cli, so I do not have 'node_modules/@angular-devkit/build-angular' folder. Any idea how to solve that problem? |
Please ask this on https://ethereum.stackexchange.com/ |
Go to \node_modules@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\browser.js and search for node which would be looking like node: false and replace it with node: { crypto: true, stream: true, fs: 'empty', net: 'empty' } Now restart the project. |
@vermadev95 Is there a way of doing this fix editing a file outside node_modules? |
I encountered the issue today again. So far, the nicest fix, I've found for this issue: |
For Angular 12 this worked for me Workaroundsweb3.js issue 4070
|
I'm using @angular version 6.0.0-rc.5
and I cannot compile this code
I got this error
With Angular version 5 everything works fine.
My package json is
The text was updated successfully, but these errors were encountered: