Closed unit11 closed 6 years ago
I am seeing this issue but my project doesn't use bootstrap.
Facing the same issue as mentioned above. with Angular CLI 1.6,
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.8",
"bootstrap": "^4.0.0-beta.3",
Duplicate: @unit11 refer this thread https://github.com/angular/angular-cli/issues/9020
Closing as a duplicate of #9020.
Actually the problem is not happening for "bootstrap": "4.0.0-beta.2", so I have to shift to "bootstrap": "4.0.0-beta.3" in order to continue the project.I have updated the "^bootstrap": "4.0.0-beta.3" in th package.json file and run "npm install" and "ng serve".The problem is not happening in that case.
{ "name": "sample-project", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^5.0.0", "@angular/common": "^5.0.0", "@angular/compiler": "^5.0.0", "@angular/core": "^5.0.0", "@angular/forms": "^5.0.0", "@angular/http": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", "@angular/router": "^5.0.0", "bootstrap": "4.0.0-beta.2", "core-js": "^2.4.1", "rxjs": "^5.5.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.5.5", "@angular/compiler-cli": "^5.0.0", "@angular/language-service": "^5.0.0", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.4.2" } }
this is related to:
I spent all day trying to fix it tried ~, ../node_modules, I defined a path @node_modules in "paths" in compilerOptions in tsconfig.json and used it nothing seems to work, so I reverted back to cli 1.5.5 but it required @angular/service-worker version to satisfy >= 1.0.0-beta.5 < 2.0.0 which I already updated to version 5.1.2, please help I'm stuck
Im also getting some wierd mixup in the path characters:
Module not found: Error: Can't resolve './....node_modules☼ont-awesome☼onts☼ontawesome-webfont.eot' in 'c:\Users\
it seems everything after the / is either missing or is using some kind of escape sequence like "/f" in "/fontawesome" is displaying as "☼"
same thing with ionic icons:
Module not found: Error: Can't resolve './....node_modulesionic-angular☼ontsnoto-sans-bold.woff' in 'c:\Users\
any ideas?
Use Bootstrap beta 2 instead.
I just updated to the latest CLI on a Mac machine and am now getting this. Our project does not use Bootstrap in any aspect.
@myspivey Yeah I had the same experience. I don't use bootstrap either.
Downgrading to "@angular/cli": "1.6.3"
fixed it for me. i.e. something changed in 1.6.4.
@myspivey same here: went to 1.6.4 and started getting this
The problem is not bootstrap related. I get the same error when I am trying to use
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
inside styles.css. That means that I cannot use angular material components!
I don't seem to be able to successfully import any css file in node_modules. Neither by using a relative path nor by using the ~. Imports that are in my application itself can be imported.
@import '~angular-tree-component/dist/angular-tree-component.css';
doesn't work
@import url('../../../../node_modules/font-awesome/css/font-awesome.min.css');
doesn't work
@import url('./sidebar.css');
this works
If you are not using bootstrap then it's due to another open bug - #9185
Had the same issue. I temporary inserted all global .css to .angular-cli.json. Builds fine.
...
"styles": [
"styles.css",
"../node_modules/font-awesome/css/font-awesome.css",
"../node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"../node_modules/material-design-icons/iconfont/material-icons.css"
],
...
change it to: @import "@angular/material/prebuilt-themes/indigo-pink.css";
by removing ~ fixed my problem
i had the same issue but solved when i've set @import 'bootstrap/dist/css/bootstrap.css'; instead of @import '~bootstrap/dist/css/bootstrap.css';
in the style.css , same solution as hassansw
@hassansw , It worked just fine! Thanks
By the way, it happened when I imported indigo theme: @import "~@angular/material/prebuilt-themes/indigo-pink.css";
Removing the '~' saved my life.
Hi @SerafimovichEugene , I have the same issue and can't solve it although I try all methods I know. I inserted bootstrap global .css to .angular.cli.json, like below but build failed:
"styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.css" ],
Any ideas for the issue mentioned above? Thanks advance for your help.
@import "@angular/material/prebuilt-themes/indigo-pink.css";
remove '~'
(Working with Angular CLI 1.6.4 and Angular 5.2.1) I was @importing "../node_modules/material-design-icons/iconfont/material-icons.css" in my main stylesheet. I removed the @import and instead referenced this stylesheet in .angular-cli.json and it solved my problem.
I donpm install
for redeployment for my project. I have the same issue too. I use ng-v
to see if it is about version of angular-cli. I find out the version is 1.6.4 now. But I have stated in package.json that the version of angular-cli should be 1.4.3. So I just downgrade the angular-cli. npm install @angular/cli@1.4.3
And this build error solved.
May be this solution is not very smart enough. But it works for my project.
{ "name": "projeto-final", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/common": "^5.0.0", "@angular/compiler": "^5.0.0", "@angular/core": "^5.0.0", "@angular/forms": "^5.0.0", "@angular/http": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", "@angular/router": "^5.0.0", "bootstrap": "^4.0.0", "core-js": "^2.4.1", "jquery": "^3.2.1", "rxjs": "^5.1.0", "zone.js": "^0.8.5", "@angular-devkit/core": "0.0.28", "@angular/animations": "^5.0.0", "bluebird": "^3.5.1", "body-parser": "^1.18.2", "express": "^4.16.2", "mongoose": "^4.13.1", "morgan": "^1.9.0", "serve-favicon": "^2.4.5" }, "devDependencies": { "@angular/cli": "1.6.4", "@angular/compiler-cli": "^5.0.0", "@types/jasmine": "~2.5.53", "@types/node": "~6.0.60", "codelyzer": "~3.2.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^1.2.1", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.4.2", "@angular/language-service": "^5.0.0", "@types/jasminewd2": "~2.0.2" } }
Angular4, ng build, same with this issue, not bootstrap, it's about icheck.
ERROR in ./node_modules/css-loader?{"sourceMap":false,"import":false}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/icheck/skins/all.css Module build failed: Error: Can't resolve 'minimal/_all.css' in 'E:\workflow-manager\workflow-frontend\node_modules\icheck\skins'.
I'm developing angular app, when I run ng build, this error showed up. Don't konw it's a bug or not, is there any ideas? Thanks.
I implemented it same as @tiandiduwuxiaoxiao in the global css -- getting the same error. If I move the bootstrap.css file to the root of the node modules folder
"styles": [ "styles.css", "../node_modules/bootstrap.css" ],
or anywhere else above the node_modules directory, no problem. Seems like a problem with traversing the directory tree.
"bootstrap": "4.0.0-beta.2",
worked for me 👍
I have same issue using both of bootstrap versions
I dont know , what the issue is your facing but in mine , i tried with refering stack overflow npm uninstall -g angular-cli npm cache clean or npm cache verify (if npm > 5) npm install -g @angular/cli@latest rm -rf node_modules npm uninstall --save-dev angular-cli npm install --save-dev @angular/cli@latest npm install and including my css by removing tilde sign (~nodemodules/..css to ../nodemodules/...css )
npm install worked for me
You have to update node.js and angular/cli.Then you have angular.json file instead of angular-cli.json file.Then you add css file into angular.json file.If youn add css file into angular-cli.json file ,errors are occured.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Versions
Repro steps
styles.css ---> @import '~bootstrap/dist/css/bootstrap.css';
Observed behavior
ERROR in ./nodemodules/css-loader?{"sourceMap":false,"importLoaders":1}!./node modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null,null],"source Map":false}!./node_modules/bootstrap/dist/css/bootstrap.css Module build failed: BrowserslistError: Unknown browser major at error (D:\angular\organicShop\node_modules\browserslist\index.js:37:11) at Function.browserslist.checkName (D:\angular\organicShop\node_modules\brow serslist\index.js:320:18) at Function.select (D:\angular\organicShop\node_modules\browserslist\index.j s:438:37) at D:\angular\organicShop\node_modules\browserslist\index.js:207:41 at Array.forEach ()
at browserslist (D:\angular\organicShop\node_modules\browserslist\index.js:1 96:13)
at Browsers.parse (D:\angular\organicShop\node_modules\autoprefixer\lib\brow sers.js:44:14)
at new Browsers (D:\angular\organicShop\node_modules\autoprefixer\lib\browse rs.js:39:28)
at loadPrefixes (D:\angular\organicShop\node_modules\autoprefixer\lib\autopr efixer.js:56:18)
at plugin (D:\angular\organicShop\node_modules\autoprefixer\lib\autoprefixer .js:62:18)
at LazyResult.run (D:\angular\organicShop\node_modules\postcss-loader\node_m odules\postcss\lib\lazy-result.js:277:20)
at LazyResult.asyncTick (D:\angular\organicShop\node_modules\postcss-loader\ node_modules\postcss\lib\lazy-result.js:192:32)
at LazyResult.asyncTick (D:\angular\organicShop\node_modules\postcss-loader\ node_modules\postcss\lib\lazy-result.js:204:22)
at processing.Promise.then._this2.processed (D:\angular\organicShop\node_mod ules\postcss-loader\node_modules\postcss\lib\lazy-result.js:231:20)
at new Promise ()
at LazyResult.async (D:\angular\organicShop\node_modules\postcss-loader\node _modules\postcss\lib\lazy-result.js:228:27)
@ ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_module s/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./src/styles.css 3:10 -186
@ ./src/styles.css
@ multi ./src/styles.css