Skip to content

Bootstrap 4 : build.prod error #2251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
akil37 opened this issue Apr 18, 2018 · 2 comments
Closed

Bootstrap 4 : build.prod error #2251

akil37 opened this issue Apr 18, 2018 · 2 comments

Comments

@akil37
Copy link

akil37 commented Apr 18, 2018

Hello,

I'm having a problem when i execute npm run build.prod.

thank you very much

Package.json : I add Bootstrap4 in the dependency ("bootstrap": "^ 4.1.0").
project.config.ts :
this.NPM_DEPENDENCIES = [
...this.NPM_DEPENDENCIES,
{src: 'jquery/dist/jquery.min.js', inject: 'libs'},
// {src: 'lodash/lodash.min.js', inject: 'libs'},
{src: 'bootstrap/dist/js/bootstrap.bundle.min.js', inject: 'libs'}
, {src: 'bootstrap/dist/css/bootstrap.min.css', inject: true} // inject into css section

];

the build command is in error: npm run build.prod
...
[17:36:10] Starting 'build.html_css'...
Unknown error from PostCSS plugin. Your current PostCSS version is 6.0.21, but postcss-merge-rules uses 5.2.18. Perhaps this is the source of the error below.

/home/projet/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:37
throw new BrowserslistError(name);
^
BrowserslistError: Unknown browser major
at error (/home/projet/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:37:11)
at Function.browserslist.checkName (/home/projet/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:320:18)
at Function.select (/home/projet/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:438:37)
at /home/projet/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:207:41
at Array.forEach ()
at browserslist (/home/projet/node_modules/postcss-merge-rules/node_modules/browserslist/index.js:196:13)
at /home/projet/node_modules/postcss-merge-rules/dist/index.js:261:51
at LazyResult.run (/home/projet/node_modules/postcss/lib/lazy-result.es6:331:20)
at LazyResult.asyncTick (/home/projet/node_modules/postcss/lib/lazy-result.es6:258:32)
at LazyResult.asyncTick (/home/projet/node_modules/postcss/lib/lazy-result.es6:270:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build.prod: gulp build.prod --color --env-config prod --build-type prod
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build.prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm -v : 5.8.0
node -v : v8.4.0
angular version is : 5.2.10

My problem is similar to the following link : angular/angular-cli#9288

@mgechev
Copy link
Owner

mgechev commented Apr 18, 2018

It's not the correct way to approach. NPM_DEPENDENCIES are JavaScript files which will be injected, not loaded with a module loader. If you're just getting started with the framework, I'd recommend you to use Angular CLI.

@mgechev mgechev closed this as completed Apr 18, 2018
@akil37
Copy link
Author

akil37 commented Apr 19, 2018

thank you very much, in fact I followed the wiki section of angular seed:
https://github.com/mgechev/angular-seed/wiki/Add-external-scripts-and-styles
I will add the bootstrap.min.css directly since CDN in index.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants