当前位置:  开发笔记 > 前端 > 正文

未捕获错误:模块构建失败:错误:找不到PostCSS配置:\ng2-admin \node_modules\bootstrap-loader错误(本机)

如何解决《未捕获错误:模块构建失败:错误:找不到PostCSS配置:\ng2-admin\node_modules\bootstrap-loader错误(本机)》经验,为你挑选了1个好方法。

我几天前从git hub克隆了ng2-admin目录并运行了npm install之后我能够运行并看到UI,现在我已经从ng2-admin中删除了node_modules文件夹,docs文件夹和dist文件夹,现在面向下面具有分散UI的浏览器控制台中的错误

那么如何解决以下错误,`

Uncaught Error: Module build failed: Error: No PostCSS Config found in: D:\ng2-admin\node_modules\bootstrap-loader
    at Error (native)
    at D:\ng2-admin\node_modules\postcss-load-config\index.js:51:26
    at Error (native)
    at D:\ng2-admin\node_modules\postcss-load-config\index.js:51:26
    at Object../node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js (http://localhost:5000/assets/vendor.bundle.js:56497:7)
    at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
    at Object../node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js (http://localhost:5000/assets/vendor.bundle.js:88168:15)
    at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
    at Object../node_modules/bootstrap-loader/lib/bootstrap.loader.js!./node_modules/bootstrap-loader/no-op.js (http://localhost:5000/assets/vendor.bundle.js:52755:22)
    at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
    at Object../node_modules/bootstrap-loader/loader.js (http://localhost:5000/assets/vendor.bundle.js:52782:18)
    at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
    at Object../src/vendor.browser.ts (http://localhost:5000/assets/vendor.bundle.js:90058:1)
    at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
    at Object.5 (http://localhost:5000/assets/vendor.bundle.js:90087:18)
    at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
    at webpackJsonpCallback (http://localhost:5000/assets/polyfills.bundle.js:25:23)
    at http://localhost:5000/assets/vendor.bundle.js:2:1
./node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js @ util.js:164
__webpack_require__ @ bootstrap 7cfd64b…:52
./node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js @ no-op.js?6a4c:4
__webpack_require__ @ bootstrap 7cfd64b…:52
./node_modules/bootstrap-loader/lib/bootstrap.loader.js!./node_modules/bootstrap-loader/no-op.js @ no-op.js:1
__webpack_require__ @ bootstrap 7cfd64b…:52
./node_modules/bootstrap-loader/loader.js @ loader.js:1
__webpack_require__ @ bootstrap 7cfd64b…:52
./src/vendor.browser.ts @ vendor.browser.ts:24
__webpack_require__ @ bootstrap 7cfd64b…:52
5 @ src async:7
__webpack_require__ @ bootstrap 7cfd64b…:52
webpackJsonpCallback @ bootstrap 7cfd64b…:23
(anonymous) @ vendor.bundle.js:2
lang.js:134 Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
client:38 [WDS] Errors while compiling.
client:80 ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js
Module build failed: Error: No PostCSS Config found in: D:\ng2-admin\node_modules\bootstrap-loader
    at Error (native)
    at D:\Client2\ng2-admin\node_modules\postcss-load-config\index.js:51:26
 @ ./~/style-loader!./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js 4:14-193
 @ ./~/bootstrap-loader/lib/bootstrap.loader.js!./~/bootstrap-loader`  /no-op.js`
 @ ./~/bootstrap-loader/loader.js
 @ ./src/vendor.browser.ts
 @ multi vendor

`

4castle.. 23

解决方案非常简单.您需要在项目根目录中添加一个文件:

postcss.config.js

在里面,内容可以是:

module.exports = {};

这是Feng SHADU现在删除的非英语答案的翻译版本.



1> 4castle..:

解决方案非常简单.您需要在项目根目录中添加一个文件:

postcss.config.js

在里面,内容可以是:

module.exports = {};

这是Feng SHADU现在删除的非英语答案的翻译版本.

推荐阅读
贴进你的心聆听你的世界
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有