gpt4 book ai didi

javascript - 如何获取 Bootstrap 的输出?

转载 作者:行者123 更新时间:2023-11-28 00:28:09 26 4
gpt4 key购买 nike

我遇到了一个错误

    ERROR in ./src/styles.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/styles.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Failed to find '../node_modules/bootstrap/scss/bootstrap'
in [
C:\Users\sfssda\OnlineShoppingCartInA6\DeepCart\src
]
at resolveModule.catch.catch (C:\Users\sfssda\OnlineShoppingCartInA6\DeepCart\node_modules\postcss-import\lib\resolve-id.js:35:13)
at <anonymous>
i 「wdm」: Failed to compile.

在开发应用程序时。我安装了:

npm install --save @ng-bootstrap/ng-bootstrap
npm i bootstrap-scss

app.module.ts 导入为

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

styles.css

@import "../node_modules/bootstrap/scss/bootstrap";

最佳答案

你的 angular.json 文件应该有像这样的 bootstrap scss/css

"architect": {
"build": {
"options": {
"styles": [
... OTHER SCSS/CSS
"node_modules/bootstrap/scss/bootstrap.scss",
"node_modules/bootstrap/scss/bootstrap-grid.scss",
"src/styles.scss"
]
...

关于javascript - 如何获取 Bootstrap 的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54532612/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com