I am facing an issue with running a file that has a .ts extension before executing npm run build to build my Angular 5 project.
package.json
"scripts": {
"ng": "ng",
"start": "ng serve",
"compile": "npm-run-all myts build",
"myts": "ts-node git.version.ts",
"build": "ng build --prod",
"test": "ng test",
},
However, I encountered an error message:
npm run compile
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfa1a8e2a9a0bda2bce2aebfa68fffe1ffe1ff">[email protected]</a> compile C:\Users\George35mk\Documents\Projects\gui\frontend\>
npm-run-all myts build
'npm-run-all' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="503e377d363f223d237d6177334a434b08627c607e60">[email protected]</a> compile: `npm-run-all myts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b6d8d19bd0d9c4dbc59bd7c6dff68698869886">[email protected]</a> compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\George35mk\AppData\Roaming\npm-cache\_logs\2018-03-01T14_47_01_179Z-debug.log
PS C:\Users\George35mk\Documents\Projects\gui\frontend\
If I run only one script, it works fine:
ts-node git.version.ts