npm script does not run through npm run <script-name> but runs when typed directly
I am trying to deploy an application on an aws linux machine. I wrote scripts to be run on Linux (for when I learn how to use pipelines in the future). For now, I created the windows-equivalent commands to be able to run the scripts on my machine.
Problem: When I try to run npm run build_win
, the script would exit at tsc
. However, when I take the rest of the script cp -rf src/config www/config && cp -R .elasticbeanstalk www/.elasticbeanstalk && cp .npmrc www/.npmrc && cp package.json www/package.json && cd www && zip -r Archive.zip . && cd ..
and run it directly in PowerShell terminal, it works. Why does not npm run build_win
work?
"scripts": {
"clean": "rm -rf www/ || true",
"build&q开发者_开发百科uot;: "npm install . && npm run clean && tsc && cp -rf src/config www/config && cp -R .elasticbeanstalk www/.elasticbeanstalk && cp .npmrc www/.npmrc && cp package.json www/package.json && cd www && zip -r Archive.zip . && cd ..",
"clean_win": "rmdir /s /q www || (exit 0)",
"build_win": "cp -r src/config www/config && cp -R .elasticbeanstalk www/.elasticbeanstalk && cp .npmrc www/.npmrc && cp package.json www/package.json && cd www && zip -r Archive.zip . && cd ..",
},
精彩评论