Skip to content

[BUG] symlinks for bin files are not created in workspaces using npm 7 on node 14 on Windows Server #2732

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

Closed
achingbrain opened this issue Feb 19, 2021 · 3 comments
Assignees
Labels
Bug thing that needs fixing platform:windows is Windows-specific Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@achingbrain
Copy link

Current Behavior:

When using the new workspaces functionality from npm 7 on node 14 on Windows, symlinks aren't always created for bin files.

This works as expected on node 15, and on Linux/Mac OS on node 14 and node 15.

I've put a demo repo together that shows the problem.

It has one package in its workspace that uses tape to run a test. Running npm test in the root of the repo lists the contents of the node_modules/.bin folder and then tries to run the test script in the sub-package.

On node 15, it works:

$ npm test
> npm7-node14-workspaces-windows@1.0.0 test
> ls -laR node_modules/.bin && npm test --prefix packages/a-package
node_modules/.bin:
total 34
drwxr-xr-x 1 travis 197121   0 Feb 19 11:56 .
drwxr-xr-x 1 travis 197121   0 Feb 19 12:25 ..
-rwxr-xr-x 1 travis 197121 328 Feb 19 11:56 ignored
-rw-r--r-- 1 travis 197121 281 Feb 19 11:56 ignored.cmd
-rwxr-xr-x 1 travis 197121 498 Feb 19 11:56 ignored.ps1
-rwxr-xr-x 1 travis 197121 312 Feb 19 11:56 tape
-rw-r--r-- 1 travis 197121 273 Feb 19 11:56 tape.cmd
-rwxr-xr-x 1 travis 197121 482 Feb 19 11:56 tape.ps1
> a-package@1.0.0 test
> tape test.js
TAP version 13
# timing test
Hello world
ok 1 should be truthy
1..1
# tests 1
# pass  1
# ok
The command "npm test" exited with 0.

On node 14 it does not:

$ npm test
> npm7-node14-workspaces-windows@1.0.0 test
> ls -laR node_modules/.bin && npm test --prefix packages/a-package
node_modules/.bin:
total 34
drwxr-xr-x 1 travis 197121   0 Feb 19 11:56 .
drwxr-xr-x 1 travis 197121   0 Feb 19 12:25 ..
> a-package@1.0.0 test
> tape test.js
The command "npm test" exited with 1.
cache.2
store build cache
Done. Your build exited with 1.
'tape' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code 1
npm ERR! path C:\Users\travis\build\achingbrain\npm7-node14-workspaces-windows\packages\a-package
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c tape test.js
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\travis\AppData\Roaming\npm-cache\_logs\2021-02-19T12_30_18_473Z-debug.log
npm ERR! Test failed.  See above for more details.

E.g. on node 15, a symlink is created at node_modules/.bin/tape on node 14 it is not created.

Tediously this all works locally with Windows 10 - it may be related to Windows Server, version 1809.

Expected Behavior:

It should work on node 14 on Windows.

Steps To Reproduce:

See the travis build: https://travis-ci.org/github/achingbrain/npm7-node14-workspaces-windows/builds/759627000

Environment:

  • OS: Windows Server, version 1809
  • Node: 15.9.0/14.15.5
  • npm: 7.5.3
@achingbrain achingbrain added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Feb 19, 2021
@achingbrain achingbrain changed the title [BUG] Workspaces [BUG] symlinks for bin files are not created in workspaces using npm 7 on node 14 on Windows Server Feb 19, 2021
@erunion
Copy link

erunion commented Feb 20, 2021

Also seeing this happen on Node 14.15.1 w/ npm@7.5.4 on OSX 10.14.6

@darcyclarke darcyclarke added Priority 1 high priority issue platform:windows is Windows-specific and removed Needs Triage needs review for next steps labels Apr 16, 2021
@darcyclarke
Copy link
Contributor

@achingbrain can you confirm that this is still happening on v7.11.2? (to get the latest, run npm i -g npm)

@gijun19
Copy link

gijun19 commented Jun 1, 2021

hi @achingbrain,

we'll be closing this issue due to inactivity. please comment back if this continues to be an issue. thanks! 🙂

@gijun19 gijun19 closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing platform:windows is Windows-specific Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants