启动项目报错:
[ERROR] 10:58:49 ⨯ Unable to compile TypeScript:
src/app.ts(38,65): error TS2304: Cannot find name 'UserInfo'.
[INFO] 10:58:53 Reinitializing TS compilation
(node:13684) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, mkdir 'C:\Users\ADMINI~1\AppData\Local\Temp\.ts-nodejUhF4F\compiled'
at Object.mkdirSync (fs.js:840:3)
at mkdirpNativeSync (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\mkdirp\lib\mkdirp-native.js:29:10)
at Function.mkdirpSync [as sync] (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\mkdirp\index.js:21:7)
at createCompiledDir (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\ts-node-dev\lib\compiler.js:139:30)
at Object.init (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\ts-node-dev\lib\compiler.js:124:9)
at FSWatcher.restart (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\ts-node-dev\lib\index.js:217:22)
at FSWatcher.emit (events.js:311:20)
at FSWatcher.EventEmitter.emit (domain.js:482:12)
at FSWatcher.emitWithAll (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\chokidar\index.js:540:8)
at FSWatcher._emit (E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\node_modules\chokidar\index.js:632:8)
(node:13684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
[INFO] 10:58:54 Reinitializing TS compilation
[INFO] 10:58:54 Restarting: E:\StudyFile\kaikeba\works\Vue\vue-trello-backend\tsconfig.json has been modified
出现UnhandledPromiseRejectionWarning:一般就是包版本问题,或者包冲突
我这里 "ts-node-dev": "^2.0.2",版本修改为 "ts-node-dev": "^1.0.0-pre.44"即可正常启动