typescript 发生未行程的例外状况:错误TS 500:错误:枚举:没有这样的文件或目录,lstat 'B:/... projects/admin/tsconfig.app.json'

qc6wkl3g  于 2022-11-18  发布在  TypeScript
关注(0)|答案(1)|浏览(356)

今天我重新打开了我在2022年7月完成的项目,当我运行npm start时,我得到了这个错误。我已经更新了所有的依赖项和Angular到最新版本。建议我下一步该怎么做

PS B:\Work\Projects\Ecommerce Website\capstone G5\Project\Frontend\projects> npm start

> eshop@0.0.0 start
> ng serve

DEPRECATED: The 'defaultProject' workspace option has been deprecated. The project to use will be determined from the current working directory.
An unhandled exception occurred: error TS500: Error: ENOENT: no such file or directory, lstat 'B:/Work/Projects/Ecommerce Website/capstone G5/Project/Frontend/projects/projects/admin/tsconfig.app.json'
    at Module.lstatSync (node:fs:1561:3)
    at NodeJSFileSystem.lstat (file:///B:/Work/Projects/Ecommerce%20Website/capstone%20G5/Project/Frontend/projects/node_modules/@angular/compiler-cli/bundles/chunk-TOKOIIBI.js:342:16)
    at calcProjectFileAndBasePath (file:///B:/Work/Projects/Ecommerce%20Website/capstone%20G5/Project/Frontend/projects/node_modules/@angular/compiler-cli/bundles/chunk-Q7TXFDI7.js:7361:29)
    at readConfiguration (file:///B:/Work/Projects/Ecommerce%20Website/capstone%20G5/Project/Frontend/projects/node_modules/@angular/compiler-cli/bundles/chunk-Q7TXFDI7.js:7386:39)
    at readTsconfig (B:\Work\Projects\Ecommerce Website\capstone G5\Project\Frontend\projects\node_modules\@angular-devkit\build-angular\src\utils\read-tsconfig.js:49:26)
    at async configureI18nBuild (B:\Work\Projects\Ecommerce Website\capstone G5\Project\Frontend\projects\node_modules\@angular-devkit\build-angular\src\utils\i18n-options.js:125:22)
    at async generateI18nBrowserWebpackConfigFromContext (B:\Work\Projects\Ecommerce Website\capstone G5\Project\Frontend\projects\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:71:36)
    at async setup (B:\Work\Projects\Ecommerce Website\capstone G5\Project\Frontend\projects\node_modules\@angular-devkit\build-angular\src\builders\dev-server\index.js:141:47)

See "C:\Users\itsad\AppData\Local\Temp\ng-MHAaUZ\angular-errors.log" for further details.

我还附上了文件夹结构,在这里你可以看到上面提到的丢失文件错误已经存在。

ar7v8xwq

ar7v8xwq1#

发生此错误的原因是,我有此前端应用程序的两个组件,这两个组件都应该保存在src文件夹中。当我这样做时,问题得到了解决,文件夹层次结构如下所示:

这是一个非常无知的错误,我将确保在未来不会在StackOverflow上提出这种性质的问题。

相关问题