node.jsnpmgithub-actions

Github action issue issue with `npm install`


Part of my work flow involves a step to install npm packages with the command npm install, but for some unknown reasons I am getting this error below. I am not sure what the error below is about or how to fix.

enter image description here


Solution

  • I guess npm not configured correctly on GitHub actions The correct configuration should be like this:

    - uses: actions/setup-node@v3
        with:
          node-version: "16"
        env:
          GITHUB_TOKEN: ${{ secrets.TESTING_GITHUB_TOKEN }}
      - run: npm config set package-lock true
      - run: echo 'package-lock=true'>> .npmrc
      - run: npm install -g npm@latest
      - run: npm i -g npm-upgrade
      - run: |
          [enter image description here][1]