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

Error: Unable to resolve module crypto from #273

Closed
90Mark opened this issue Mar 13, 2020 · 12 comments
Closed

Error: Unable to resolve module crypto from #273

90Mark opened this issue Mar 13, 2020 · 12 comments

Comments

@90Mark
Copy link

90Mark commented Mar 13, 2020

crypto-js use version @4.0.0

My project is reactnative,I'm just do...

  1. npm install —-save crypto-js

  2. import MD5 from 'crypto-js/md5'

And then,Is an error,The following information:

error: bundling failed: Error: Unable to resolve module crypto from node_modules/crypto-js/core.js: crypto could not be found within the project.

Please tell me what I should do,,Thank you very mucha

@Waitak
Copy link

Waitak commented Mar 16, 2020

I have this same issue, with the same version, running node v12.16.1. This is in an Angular 9 project. The crypto module is available in node:

% node
Welcome to Node.js v12.16.1.
Type ".help" for more information.
> require('crypto');
{
  createCipheriv: [Function: createCipheriv],
  createDecipheriv: [Function: createDecipheriv],
  createDiffieHellman: [Function: createDiffieHellman],
  createDiffieHellmanGroup: [Function: createDiffieHellmanGroup],
...

@ivandres
Copy link

I am having the same issue (Angular 9)

Module not found: Can't resolve 'crypto' in '..../node_modules/crypto-js'

@joaodematejr
Copy link

+1 I am having the same issue (React-Native 0.60)

@ingmaaguirre
Copy link

I am having the same issue (Angular 9)

WARNING in ./node_modules/crypto-js/core.js
Module not found: Error: Can't resolve 'crypto' in

@90Mark
Copy link
Author

90Mark commented Mar 23, 2020

resolved

use "crypto-js": "3.1.9-1"

@marshall86
Copy link

using version 4.0.0, still there's the same problem

@Alanscut
Copy link
Contributor

the latest version v4.0.0 has used secure random module, but reactive-native doesn't have the crypto module, the owner @evanvosberg is trying to fix this issue, detail in #259 , but still has some problem.

so if you want to use crypto-js in react-native project, v3.1.9-1(or before) is a temporary choice before this issue has been fixed.

@hu-qi
Copy link

hu-qi commented Mar 30, 2020

the latest version v4.0.0 has used secure random module, but reactive-native doesn't have the crypto module, the owner @evanvosberg is trying to fix this issue, detail in #259 , but still has some problem.

so if you want to use crypto-js in react-native project, v3.1.9-1(or before) is a temporary choice before this issue has been fixed.

image
I am having the same issue (React-Native 0.62)
I try to install ** v3.1.9-1** and it will work

@90Mark
Copy link
Author

90Mark commented Mar 30, 2020 via email

@entronad
Copy link
Contributor

If the issues caused by secure radom of crypto-js 4.0 bother you, such as too large bundle, unavalible in React Native... Maybe you can try crypto-es .

We merged all updates of crypto-js 4.0 except the secure radom.

@90Mark 90Mark closed this as completed Apr 13, 2020
@90Mark 90Mark reopened this Apr 13, 2020
@90Mark 90Mark closed this as completed Apr 13, 2020
@IamFlowZ
Copy link

Having this issue while setting up a react-native project, would be great to see a fix for this.

@HugoLiconV
Copy link

Having this issue while setting up a react-native project, would be great to see a fix for this.

Me too, but the solutions that people shared solved the issue.

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