gpt4 book ai didi

angular - 在使用 angular-cli@1.0.0-beta.21 执行 ng build -prod 时找不到模块 css-loader

转载 作者:太空狗 更新时间:2023-10-29 17:03:23 25 4
gpt4 key购买 nike

我有以下 package.json 配置

"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/router": "3.2.1",
"@angular2-material/button": "^2.0.0-alpha.8-2",
"@angular2-material/button-toggle": "^2.0.0-alpha.8-2",
"@angular2-material/card": "^2.0.0-alpha.8-2",
"@angular2-material/checkbox": "^2.0.0-alpha.8-2",
"@angular2-material/core": "^2.0.0-alpha.8-2",
"@angular2-material/grid-list": "^2.0.0-alpha.8-2",
"@angular2-material/icon": "^2.0.0-alpha.8-2",
"@angular2-material/input": "^2.0.0-alpha.8-2",
"@angular2-material/list": "^2.0.0-alpha.8-2",
"@angular2-material/menu": "^2.0.0-alpha.8-2",
"@angular2-material/progress-bar": "^2.0.0-alpha.8-2",
"@angular2-material/progress-circle": "^2.0.0-alpha.8-2",
"@angular2-material/radio": "^2.0.0-alpha.8-2",
"@angular2-material/sidenav": "^2.0.0-alpha.8-2",
"@angular2-material/slide-toggle": "^2.0.0-alpha.8-2",
"@angular2-material/slider": "^2.0.0-alpha.8-2",
"@angular2-material/tabs": "^2.0.0-alpha.8-2",
"@angular2-material/toolbar": "^2.0.0-alpha.8-2",
"@angular2-material/tooltip": "^2.0.0-alpha.8-2",
"ng2-material-dropdown":"0.5.4",
"ng2-toasty": "^2.2.2",
"@types/hammerjs": "^2.0.30",
"angular2-cookie": "1.2.3",
"angular2-material-datepicker": "^0.5.0",
"angulartics2": "^1.1.9",
"core-js": "^2.4.1",
"d3": "^4.3.0",
"es6-shim": "0.35.1",
"ng2-datetime-picker": "^0.11.3",
"ng2-tag-input": "0.6.0",
"ng2-auto-complete":"0.8.2",
"reflect-metadata": "0.1.3",
"rickshaw": "^1.6.0",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23",
"ng2-file-upload": "^1.1.4-2",
"angular2-color-picker": "^1.3.0",
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.16"
},
"devDependencies": {
"@types/jasmine": "^2.2.30",
"angular-cli": "1.0.0-beta.21",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.5",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.0.2",
"typings": "1.3.1"

ng build -prod 工作正常,但是突然之间相同的配置出现以下错误

ERROR in ./src/styles.css
Module build failed: Error: Cannot find module '/Volumes/DATA/new- clone-test/nbw/node_modules/css-loader/index.js?sourcemap&minimize'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at loadLoader (/Volumes/DATA/new-clone-test/nbw/node_modules/loader-runner/lib/loadLoader.js:13:17)

我不确定是什么导致了这个问题。任何帮助都感激不尽。

最佳答案

我遇到了和你一样的问题。作为临时解决方案,我更改为“ng build --dev”。使用此命令,加载程序使用 webpack-build-development.js 而不是 webpack-build-production.js 并获取 'css-loader?sourcemap' 而不是 'css-loader?sourcemap&minimize'。

关于angular - 在使用 angular-cli@1.0.0-beta.21 执行 ng build -prod 时找不到模块 css-loader,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41889869/

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