1
$ npm run deploy:local

> backend@0.1.0 deploy:local
> eval "`aws-auth-helper ` lerna run deploy:sandbox --stream"

'eval' is not recognized as an internal or external command,
operable program or batch file.

Node version:

$ node --version
v15.11.0

NPM version:

$ npm --version
7.6.0

I am using VSCode Bash terminal. It had been working just fine but then I started getting this error. Have tried both bash terminal and javascript terminal.

If I just type "eval" in the bash terminal, it works okay. While running through npm script it does not.

systemdebt
  • 4,589
  • 10
  • 55
  • 116
  • 1
    Seems like you are using a command designed for bash inside batch/cmd. There is a huge difference between linux' bash and windows' batch. Please make sure that you are actually using the latter. – Socowi Mar 24 '21 at 23:20
  • @Socowi I am using https://stackoverflow.com/a/50527994/2699001 . Do I need to switch to something else? – systemdebt Mar 24 '21 at 23:21
  • I have no idea. In windows there is no pre-installed bash. Therefore I don't know if you even can *switch* to bash. You might have to install WSL, git-bash, cygwin or something like that first. – Socowi Mar 24 '21 at 23:23
  • It is infact git-bash that is currently being used and I am under the impression that it used to work just fine as is – systemdebt Mar 24 '21 at 23:27
  • 1
    `is not recognized as an internal or external command, operable program or batch file.` is cmd's message when it encounters an unknown command. I don't know node.js but you either write a cmd command, or change node.js' default shell somehow, or call bash from cmd – phuclv Mar 25 '21 at 04:40

1 Answers1

1

Since you are on a Windows environment, even if the shell you're executing from is bash, npm will likely be executing the run script in the default shell of Windows (PS now, I think?).

If bash is in your PATH variable(1), you could try modifying your package.json file in this way:

{
//... other keys
  "scripts" : {
    //... other keys
    "deploy" : "bash -c \"eval `aws-auth-helper ` lerna run deploy:sandbox --stream\" "
  }
}

(1) Or use the full path to bash.exe

kevinnls
  • 728
  • 4
  • 19