Skip to content

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

Open

Description

@wleionly

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'

Activity

  1. CristianDallos commented on Apr 4, 2019

    @CristianDallos

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

  2. CristianDallos commented on Apr 6, 2019

    @CristianDallos

    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.

  3. jkroepke commented on Apr 20, 2019

    @jkroepke
  4. NewtonJoshua commented on Aug 29, 2019

    @NewtonJoshua

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions