I am currently working on a project using node, express, and TypeScript. When I run npm run build
, everything builds without any issues. However, when I attempt to run npm run start
, I encounter the following error:
@ruler-mobility/[email protected] /Users/macbook/Desktop/ruler
> npm run serve
> @ruler-mobility/[email protected] serve /Users/macbook/Desktop/ruler
> node dist/app.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ruler-mobility/[email protected] serve: `node dist/app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! The script '@ruler-mobility/[email protected] serve' failed.
npm ERR! This is likely not a problem with npm. Additional logging output can be found above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/macbook/.npm/_logs/2020-02-21T20_53_55_009Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ruler-mobility/[email protected] start: `npm run serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! The script '@ruler-mobility/[email protected] start' failed.
npm ERR! This is likely not a problem with npm. Additional logging output can be found above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/macbook/.npm/_logs/2020-02-21T20_53_55_045Z-debug.log
Note: 'ruler' is the name of the project.
The scripts defined in my package.json are structured as follows:
"scripts": {
"start": "npm run serve",
"build": "npm run build-source",
"serve": "node dist/app.js",
"watch-node": "nodemon dist/app.js",
// Other script configurations...
},
Here is my tsconfig.json file:
{
"compilerOptions": {
// Compiler options listed here...
},
"exclude": ["node_modules", "**/*.spec.ts"]
}
As a beginner in TypeScript, could someone please guide me on how to correctly run my project?
Thank you.