auth0 / node-jsonwebtoken

JsonWebToken implementation for node.js http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html
MIT License
17.75k stars 1.23k forks source link

npm audit fails on node v14 #867

Closed natlibfi-jonollil closed 1 year ago

natlibfi-jonollil commented 1 year ago

Description

Package auditing fails on node 14. This is not issue for us since it works on 16 & 18, we just move to node 18 on this, but it might be problem for someone else.

Reproduction

  1. "jsonwebtoken": "^9.0.0" in package.json
  2. import jwt from 'jsonwebtoken'; in js file (Babel) (Not sure if this is needed)

And when Github action runs on command 'npm audit --package-lock-only --production --audit-level=moderate'

name: Node-tests

on: push

jobs:
  build-node-versions:
    name: Node version matrix
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x, 16.x, 18.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - name: Checkout the code
      uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
      env:
        NPM_CONFIG_IGNORE_SCRIPTS: true
    - run: npm audit --package-lock-only --production --audit-level=moderate
  1. On node 14 - Fail: npm ERR! Cannot read property 'jsonwebtoken' of undefined
  2. On node 16 - OK
  3. On node 18 - OK Screenshot 2022-12-29 at 12-12-51 jsonwebtoken init fix · NatLibFi_passport-melinda-jwt-js@84847f3

Environment

panva commented 1 year ago

We're unable to help with npm issues. https://github.com/npm/cli might be the right venue for these issues.