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

[BUG] NPM stopped creating node_modules/.bin folder #7667

Closed
2 tasks done
mykola-mokhnach opened this issue Jul 19, 2024 · 5 comments
Closed
2 tasks done

[BUG] NPM stopped creating node_modules/.bin folder #7667

mykola-mokhnach opened this issue Jul 19, 2024 · 5 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@mykola-mokhnach
Copy link

mykola-mokhnach commented Jul 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

We can observe that after installing the Node.js version 22.5.0 on the Github ubuntu-latest runner no node_modules/.bin folder is being created for package installations. This renders all utils, like eslint or mocha unavailable. The same works fine with previous node versions.

See the job https://github.com/appium/appium-mac2-driver/actions/runs/10004344335/job/27652861367?pr=311 for more details.

All other jobs with lower node versions pass with exactly the same config.

Expected Behavior

The node_modules/.bin folder must be there after package installation.

Steps To Reproduce

  1. ubuntu-latest GH actions image
  2. https://github.com/appium/appium-mac2-driver/blob/a05fa4b38803dbf1e6b1d46567be4d9c21d3284f/.github/workflows/unit-test.yml
  3. Run npm install then run npm run lint
  4. Error in the terminal: eslint: command not found

Environment

  • npm: 10.8.2
  • Node.js: 22.5.0
  • OS Name: ubuntu-latest (24.04)
  • System Model Name: GH Actions Runner
  • npm config: -
@mchmatt
Copy link

mchmatt commented Jul 19, 2024

This is just a side effect - the step above it is failing silently (see #7672):
image
As a quick fix, make setup-node use v22.4 instead of latest

@milaninfy
Copy link
Contributor

Closing duplicate of #7657.
Try node 22.4.1 with npm 10.8.2.

@mykola-mokhnach
Copy link
Author

thanks for the suggestion @milaninfy

Unfortunately it is not so simple for this particular case to use another Node.js version as they are retrieved automatically based on the latest LTS snapshots:

jobs:
  prepare_matrix:
    runs-on: ubuntu-latest
    outputs:
      versions: ${{ steps.generate-matrix.outputs.active }}
    steps:
    - name: Select all active LTS versions of Node.js
      id: generate-matrix
      uses: msimerson/node-lts-versions@v1

  test:
    needs:
    - prepare_matrix
    strategy:
      matrix:
        node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}

We'd probably need to wait for the next node patch 🤷

@Sebastian-Webster
Copy link

Hi @mykola-mokhnach, a quick workaround for that problem would be to set the node version manually like this:

jobs:
  test:
    strategy:
      matrix:
        node-version: [18.x, 20.x, 22.4.1]
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}

and then once the patch for Node.js comes out you can go back to using the node-lts-versions action

@Sebastian-Webster
Copy link

Hi @mykola-mokhnach, never mind, Node.js 22.5.1 has came out and fixes that issue. nodejs/node#53902 (comment)

Elanis added a commit to Dysnomia-Studio/dysnomia-wiki that referenced this issue Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

4 participants