I've searched for days but did not find an answer that worked for my problem.
I want to run a npm script through cmd or Powershell in Windows and pass values for script variables.
I would like the bellow script in package.json
:
"scripts": {
"happy-birthday": "echo Happy birthday $NAME and many returns!"
}
To output:
Happy birthday Danny and many returns!
With a command like:
npm run happy-birthday --NAME=Danny
Everything I tested so far gives me:
Happy birthday $NAME and many returns!
It feels like npm does not recognize this as a variable and prints it like it is a string. I also tested %NAME%.
Npm version - 6.12.1