Skip to content
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

'"-S"' is not recognized as an internal or external command, #19

Open
huan opened this issue Sep 5, 2021 · 0 comments
Open

'"-S"' is not recognized as an internal or external command, #19

huan opened this issue Sep 5, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@huan
Copy link
Owner

huan commented Sep 5, 2021

The Problem

We need to put --no-warnings --loader ts-node/esm --experimental-vm-modules to node args, so we use env -S:

#!/usr/bin/env -S node --no-warnings --loader ts-node/esm --experimental-vm-modules

However, this will generate the following node_modules/.bin files:

IF EXIST "%dp0%\-S.exe" (
  SET "_prog=%dp0%\-S.exe"
) ELSE (
  SET "_prog=-S"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)
if (Test-Path "$basedir/-S$exe") {
  # Support pipeline input
  if ($MyInvocation.ExpectingInput) {
    $input | & "$basedir/-S$exe" node --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" $args
  } else {
    & "$basedir/-S$exe" node --no-warnings --loader ts-node/esm --experimental-vm-modules "$basedir/../sidecar/dist/esm/bin/sidecar-dump.js" $args
  }
  $ret=$LASTEXITCODE
}

The -S.exe and -s$exe are both not correct, which should be set to node.exe

The Solution

To be investigated.

#!/usr/bin/env -S NODE_OPTIONS="--no-warnings --loader ts-node/esm --experimental-vm-modules" node

Related resources

Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant