Skip to content

[BUG] node_modules/.bin directory and symlinks no longer being created after upgrading from v6 to v8 #4308

@busticated

Description

@busticated

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

After upgrading my project from v6.14.16 to v8.3.2, the node_modules/.bin directory and associated symlinks are no longer created when running npm i

Expected Behavior

node_modules/.bin directory and associated symlinks are created after running npm i, bare executable names are recognized when used within scripts - e.g. using a script like:

  "scripts": {
    "postinstall": "lerna bootstrap"
  },

...running npm run postinstall directly (or implicitly after npm i) works, the lerna name resolves to node_modules/.bin/lerna which inturn poinst to ../lerna/cli.js

Steps To Reproduce

  1. using npm@v6.14.16 and node@v16.13.2 on macOS v12.0.1 (intel)
node --eval 'console.log(process.versions)'
{
  node: '16.13.2',
  v8: '9.4.146.24-node.14',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '93',
  nghttp2: '1.46.0',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '1.1.1m',
  cldr: '39.0',
  icu: '69.1',
  tz: '2021a',
  unicode: '13.0'
}
  1. run npm i npm@8 --global
  2. run rm -rf node_modules
  3. run npm i
  4. run ls -la node_modules/.bin
  5. observe the error: No such file or directory

Environment

  • npm: v8.3.2
  • Node.js: v16.13.2
  • OS Name: macOS
  • System Model Name: Monterey (v12.0.1 intel)
  • npm config:
; "builtin" config from /usr/local/lib/node_modules/npm/npmrc

prefix = "/usr/local" 

; "user" config from /Users/me/.npmrc

//registry.npmjs.org/:_authToken = (protected) 

; node bin location = /usr/local/Cellar/node@16/16.13.2/bin/node
; cwd = /Users/me/code/particle/js-utils
; HOME = /Users/me
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 1high priority issueRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions