开发者

npm script does not run through npm run <script-name> but runs when typed directly

开发者 https://www.devze.com 2022-12-07 19:09 出处:网络
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 comman

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 ..",
  },
0

精彩评论

暂无评论...
验证码 换一张
取 消