After some research, I found that which.sync will throw a error like this:
TypeError: (opt.path || process.env.PATH || "").split is not a function
at getPathInfo (/xxxx/test/test-pnpm/test-publish/node_modules/.pnpm/@zkochan+which@2.0.3/node_modules/@zkochan/which/which.js:19:56)
it seems that @zkochan/which only accept string path option.
Code to reproduce the issue:
Here is steps to reproduce:
pnpm add safe-execa
touch exec.mjs
with follow contents:node ./exec.mjs
will see the error below:Expected behavior:
should execute command successfully.
Additional information:
node -v prints:
v16.15.1
safe-execa version:v0.1.2
Windows, macOS, or Linux?:macOS
After some research, I found that which.sync will throw a error like this:
it seems that
@zkochan/which
only accept string path option.