你好,我在我的机器上安装了最新版本的Angular CLI。我试图在Angular项目中安装Bootstrap。
以下是我遵循的步骤:
- ng new Demo
- npm install bootstrap jquery --save
然后在vs code中打开项目的angular.json文件,复制以下代码:
"styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/bootstrap/dist/js/bootstrap.js" ]
之后我运行了该项目的ng serve命令,但出现了以下错误信息:
请注意,在angular.json文件中添加引用的CSS和JS文件时,确保路径正确。此外,您还需要检查本地是否存在所需的CSS和JS文件。Angular Live Development Server is listening on localhost: 4200, open your browser on http://localhost:4200/ ** 91% additional asset processing scripts-webpack-plugin× 「wdm」: Error: ENOENT: no such file or directory, open 'D:\Angular\node_modules\jquery\dist\jquery.min.js'