Edgar256
Edgar256

Reputation: 902

Getting Error "Cannot find module crypto" when building APK with Expo. How do I fix this error?

Getting Error "Cannot find module crypto" when building APK with Expo. How do I fix this error?Here is the error , cannot not seem to be able to fix this

    While trying to resolve module `crypto` from file `C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\jws\node_modules\jwa\index.js`, the package `C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\index.js`. Indeed, none of these files exist:      
    
      * C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\index.js(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
      * C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\index.js\index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
    Error: While trying to resolve module `crypto` from file `C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\jws\node_modules\jwa\index.js`, the package `C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\index.js`. Indeed, none of these files exist:
    
      * C:\Users\EDGAR\Desktop\DStarMobileApp\node_modules\crypto\index.js(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)

Upvotes: 0

Views: 473

Answers (1)

Ayush Singh
Ayush Singh

Reputation: 126

Downgrade the version of crypto package and it should work.

Upvotes: 1

Related Questions