嗨,我的机器里有最新的棱镜。我试着在上安装引导程序。以下是我所遵循的步骤。
在此之后,我运行的项目ng服务,我得到了这个错误消息。
正在侦听localhost: 4200,在http://localhost:4200/上打开浏览器** 91%额外的资产处理脚本-webpack-pluginדwdm”:错误: ENOENT:没有这样的文件或目录,打开'D:\Angular\node_modules\jquery\dist\jquery.min.js‘
发布于 2018-05-10 19:12:51
对于构建和项目配置,角6上的CLI项目将使用angular.json而不是.angular-cli.json。
每个CLI工作区都有项目,每个项目都有目标,每个目标可以有配置。
. {
"projects": {
"my-project-name": {
"projectType": "application",
"architect": {
"build": {
"configurations": {
"production": {},
"demo": {},
"staging": {},
}
},
"serve": {},
"extract-i18n": {},
"test": {},
}
},
"my-project-name-e2e": {}
},
}在angular.json中,将文件路径添加到build目标下的样式和脚本数组中,使用./而不是../
对样式数组执行npm install --save font-awesome和addd文件路径
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ng6",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css","./node_modules/bootstrap/dist/css/bootstrap.min.css"
"./node_modules/font-awesome/css/font-awesome.css"
],
"scripts": ["./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js"]
},发布于 2021-11-19 22:20:38
将命令行放在项目上,然后运行:
npm install bootstrap@next然后,将您的ide转到Angular.json并键入styles:
"styles": [ "node_modules/bootstrap/dist/css/bootstrap.css", "src/styles.css" ]对脚本执行同样的操作:
"scripts": [ "node_modules/bootstrap/dist/js/bootstrap.min.js" ]https://stackoverflow.com/questions/50278598
复制相似问题