我只是安装了“ Nest公司诉10”,一开始就有错误。
> nest start --watch
> SWC Running...
Successfully compiled: 4 files with swc (14.34ms)
Watching for file changes.
Error: Cannot find module src/app.module
Require stack:
- /Volumes/NestJs/dist/main.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Function.Module._load (node:internal/modules/cjs/loader:920:27)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (/Volumes/NestJs/dist/main.js:6:20)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Function.Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
✔ TSC Initializing type checker...
> TSC Found 0 issues.
http://strong>。
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true,
"builder": "swc",
"typeCheck": true
}
}
页: 1
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
}
}
I m Usnes v10.2.3 and Node v18.16
I try change "baseUrl": "./" to "baseUrl": "./src" but still not work