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

Can't resolve 'zlib' in /node_modules/node-jose/lib/jwe/encrypt.js and /node_modules/node-jose/lib/jwe/decrypt.js #257

Open
wleionly opened this issue Apr 3, 2019 · 4 comments

Comments

@wleionly
Copy link

wleionly commented Apr 3, 2019

I included jose.JWK.asKey() into our progrem, as:
jose.JWK.asKey({
'kty': 'oct',
'use': 'enc',
'k': name,
'alg': 'password'
})
.then(key => {
jose.JWE.createDecrypt(key)
.decrypt(token)
.then(result => {
const claims = new TextDecoder().decode(result.plaintext);
sessionStorage.setItem('detail', claims);
});
});
but I get a error as
ERROR in ./node_modules/node-jose/lib/jwe/encrypt.js
Module not found: Error: Can't resolve 'zlib' in '/Users/projectName/node_modules/node-jose/lib/jwe'
ERROR in ./node_modules/node-jose/lib/jwe/decrypt.js
Module not found: Error: Can't resolve 'zlib' in '/Users/projectName/node_modules/node-jose/lib/jwe'

@CristianDallos
Copy link

CristianDallos commented Apr 4, 2019

I have the same problem in angular app, when I change version: 5.2 to 7.

@CristianDallos
Copy link

Hello, maybe it's helpful, I was reviewing and I found that the problem occurs when uploading the CLI version in angular, 1.7.x to 6.

@jkroepke
Copy link

Workaround: VadimDez/ng2-pdf-viewer#322 (comment)

@NewtonJoshua
Copy link

NewtonJoshua commented Aug 29, 2019

Hi,
This PR will fix this issue #264

It is published to https://www.npmjs.com/package/node-jose-browserify

npm i node-jose-browserify

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

4 participants