You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const [, base, command] = basename(file).match(/^(\w+)-(.+)$/);
^
TypeError: basename is not iterable (cannot read property Symbol(Symbol.iterator))
at Object.<anonymous> (D:\a\cml\cml\bin\legacy.js:12:27)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
NPM uses cmd-shim on Windows instead of creating symbolic links. This shim consists of a hardcoded script that calls the executables specified on package.json:bin with the node interpreter, and, because of the indirect call, $0 gets lost in the process.
Because of this, basename(file) equals legacy.js instead of cml-command as expected. Therefore, /^(\w+)-(.+)$/ doesn't match anything (obviously) and we don't have any means to determine which legacy command was called.
Activity
0x2b3bfa0 commentedon Sep 22, 2021
This only affects legacy commands on Windows, and doesn't have any
easyrealistic solution. Should we just ignore it?Remove multiplatform legacy command tests
Remove multiplatform legacy command tests
0x2b3bfa0 commentedon Sep 22, 2021
🔔 @iterative/cml, voting to close without changes through #737
0x2b3bfa0 commentedon Sep 22, 2021
https://github.com/npm/documentation/issues/39
Disable legacy command tests on Windows (#737)