卸载包后 Ng 服务不工作
Ng serve not working after uninstalling a package
Can you guys help me on how I can run ng serve
again successfully.
我在一个使用 Bootstrap 的 Angular 项目上工作,然后我安装了 Angular Material,我的设计被毁了。因此,我尝试使用 npm uninstall @angular/material
卸载 Angular Material,结果卸载成功。我关闭了 运行ning 服务器 localhost:4200
,然后尝试使用 ng serve
再次 运行 项目,但它给了我这个错误 An unhandled exception occurred: ENOENT: no such file or directory, lstat 'D:\desktop\github_repos\library-management-system\node_modules\@angular\material' See "C:\Users\Dell\AppData\Local\Temp\ng-XYBGzp\angular-errors.log" for further details.
跟进问题:Bootstrap和Angular Material不能一起工作吗?
谢谢!
And this is the contents inside the angular-errors.log
file:
at Object.realpathSync (fs.js:1800:7)
at resolveGlobalStyles (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:54:31)
at Object.getStylesConfig (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:87:70)
at D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:153:23
at generateWebpackConfig (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:59:49)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async generateBrowserWebpackConfigFromContext (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:116:20)
at async Object.generateI18nBrowserWebpackConfigFromContext (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:66:20)
at async setup (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:149:47)```
确保您没有在代码中使用任何 Angular Material。并检查 package.json 如果 @angular/material
从依赖项列表中删除,则 运行 ‘ npm install ‘
Can you guys help me on how I can run
ng serve
again successfully.
我在一个使用 Bootstrap 的 Angular 项目上工作,然后我安装了 Angular Material,我的设计被毁了。因此,我尝试使用 npm uninstall @angular/material
卸载 Angular Material,结果卸载成功。我关闭了 运行ning 服务器 localhost:4200
,然后尝试使用 ng serve
再次 运行 项目,但它给了我这个错误 An unhandled exception occurred: ENOENT: no such file or directory, lstat 'D:\desktop\github_repos\library-management-system\node_modules\@angular\material' See "C:\Users\Dell\AppData\Local\Temp\ng-XYBGzp\angular-errors.log" for further details.
跟进问题:Bootstrap和Angular Material不能一起工作吗?
谢谢!
And this is the contents inside the
angular-errors.log
file:
at Object.realpathSync (fs.js:1800:7)
at resolveGlobalStyles (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:54:31)
at Object.getStylesConfig (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\webpack\configs\styles.js:87:70)
at D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:153:23
at generateWebpackConfig (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:59:49)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async generateBrowserWebpackConfigFromContext (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:116:20)
at async Object.generateI18nBrowserWebpackConfigFromContext (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\utils\webpack-browser-config.js:66:20)
at async setup (D:\desktop\github_repos\library-management-system\node_modules\@angular-devkit\build-angular\src\dev-server\index.js:149:47)```
确保您没有在代码中使用任何 Angular Material。并检查 package.json 如果 @angular/material
从依赖项列表中删除,则 运行 ‘ npm install ‘