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

Linking fails: Windows #17

Closed
katerlol opened this issue May 3, 2021 · 4 comments
Closed

Linking fails: Windows #17

katerlol opened this issue May 3, 2021 · 4 comments

Comments

@katerlol
Copy link

katerlol commented May 3, 2021

When i try to install openPGP in a regular CMD i get an error, so I had to switch to git bash on windows to install it. After that the npm install was successful.

Now i am trying to link the package with calling react-native link react-native-fast-openpgp but i get an error on every terminal (Powershell/Webstorm IDE/Git Bash/CMD) no matter if it's called as administrator or not, which says:

warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release.
Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
(node:43868) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
error EPERM: operation not permitted, scandir 'D:/react-native/CalcPro/node_modules/react-native-fast-openpgp/ios/Openpgp.framework/Headers'. Run CLI with --verbose flag for more details.
Error: EPERM: operation not permitted, scandir 'D:/react-native/CalcPro/node_modules/react-native-fast-openpgp/ios/Openpgp.framework/Headers'
    at Object.readdirSync (node:fs:1072:3)
    at GlobSync._readdir (D:\react-native\CalcPro\node_modules\glob\sync.js:288:41)
    at GlobSync._readdirInGlobStar (D:\react-native\CalcPro\node_modules\glob\sync.js:267:20)
    at GlobSync._readdir (D:\react-native\CalcPro\node_modules\glob\sync.js:276:17)
    at GlobSync._processReaddir (D:\GitProjects\react-native\CalcPro\node_modules\glob\sync.js:137:22)
    at GlobSync._process (D:\react-native\CalcPro\node_modules\glob\sync.js:132:10)
    at GlobSync._processGlobStar (D:\GitProjects\react-native\CalcPro\node_modules\glob\sync.js:380:10)
    at GlobSync._process (D:\react-native\CalcPro\node_modules\glob\sync.js:130:10)
    at GlobSync._processGlobStar (D:\GitProjects\react-native\CalcPro\node_modules\glob\sync.js:383:10)
    at GlobSync._process (D:\react-native\CalcPro\node_modules\glob\sync.js:130:10)
@jerson
Copy link
Owner

jerson commented May 3, 2021

hi @klinger2709 thanks for report the issue, i released a new version with a possible fix for this,
https://www.npmjs.com/package/react-native-fast-openpgp/v/1.6.5

please let me know if doest work i havent tested yet in windows but for linux and mac seems works well

@katerlol
Copy link
Author

katerlol commented May 3, 2021

Hi and thank you for the quick fix. It seems to work like a charm now after the upgrade.

However It still doesn't work how i suppose it should work. I've had this exact error before creating this issue aswell, but thought it might be solved after the linking is done without errors.

I am currently using expo version 4.4.3, react 16.13.1 and react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz and testing it on an iPhone with the Expo Go App.

My code looks something like this:

import OpenPGP from "react-native-fast-openpgp";

_generateKeys = async () => {
        const generated = await OpenPGP.generate({
            cipher: 'aes256',
        }).catch(e => console.log(e));
        console.log(generated);
    };
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'RNFastOpenPGP.generate')]
at node_modules\react-native-fast-openpgp\lib\index.js:40:4 in OpenPGP.generate
at Screens\ChatScreen.js:11:8 in _generateKeys
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:293:29 in invoke
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:154:27 in invoke
at node_modules\regenerator-runtime\runtime.js:189:16 in PromiseImpl$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:45:6 in tryCallTwo
at node_modules\react-native\node_modules\promise\setimmediate\core.js:200:22 in doResolve
at node_modules\react-native\node_modules\promise\setimmediate\core.js:66:11 in Promise
at node_modules\regenerator-runtime\runtime.js:188:15 in callInvokeWithMethodAndArg
at node_modules\regenerator-runtime\runtime.js:211:38 in enqueue
at node_modules\regenerator-runtime\runtime.js:238:8 in exports.async
at Screens\ChatScreen.js:8:20 in _generateKeys
...

@jerson
Copy link
Owner

jerson commented May 3, 2021

@klinger2709 this library is not compatible with Expo Go App, so if you want to use it, you need to eject expo before
https://docs.expo.io/bare/customizing/

@katerlol
Copy link
Author

katerlol commented May 6, 2021

With the ejection it works perfectly. I just had to wrap my head around it! Thank you again for the fast responses!!

@katerlol katerlol closed this as completed May 6, 2021
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

2 participants