Я работаю с проектом node + express + type-srcipt. Я запускаю npm run build
, все работает нормально, но когда я запускаю npm run start
, я получаю эту ошибку.
@ruler-mobility/ruler@1.0.0 start /Users/macbook/Desktop/ruler
> npm run serve
> @ruler-mobility/ruler@1.0.0 serve /Users/macbook/Desktop/ruler
> node dist/app.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ruler-mobility/ruler@1.0.0 serve: `node dist/app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ruler-mobility/ruler@1.0.0 serve 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! /Users/macbook/.npm/_logs/2020-02-21T20_53_55_009Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ruler-mobility/ruler@1.0.0 start: `npm run serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ruler-mobility/ruler@1.0.0 start 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! /Users/macbook/.npm/_logs/2020-02-21T20_53_55_045Z-debug.log
Примечание: линейка - это имя проекта.
мои скрипты в пакете. json настроены так:
"scripts": {
"start": "npm run serve",
"build": "npm run build-source",
"serve": "node dist/app.js",
"watch-node": "nodemon dist/app.js",
"watch": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"cyan.bold,green.bold\" \"npm run watch-source\" \"npm run watch-node\"",
"build-source": "webpack",
"watch-source": "webpack -w",
"debug": "npm run build && npm run watch-debug",
"serve-debug": "nodemon --inspect dist/app.js",
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"cyan.bold,green.bold\" \"npm run watch-source\" \"npm run serve-debug\"",
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\" --quiet --fix",
"test": "jest --forceExit --coverage --verbose",
"watch-test": "npm run test -- --watchAll",
"stop-win": "Taskkill /IM node.exe /F",
"stop-linux": "killall node"
},
здесь мой файл tscongfig. json:
{
"compilerOptions": {
"alwaysStrict": true,
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"jsx": "react",
"lib": ["es6", "dom"],
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": ["node_modules/*"],
"@ruler": ["src", "packages"],
"@ruler/*": ["src/*", "packages/*"],
"@ruler/configs": ["configs"],
"@ruler/configs/*": ["configs/*"],
"@ruler/test": ["test"],
"@ruler/test/*": ["test/*"],
"@ruler/types": ["types"],
"@ruler/types/*": ["types/*"]
}
},
"exclude": ["node_modules", "**/*.spec.ts"]
}
Я новичок в машинописи, может кто-нибудь сказать мне, как мне запустить мой проект?
Спасибо.