Description
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