question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm modules, bootstrap and css

See original GitHub issue

Trying to use npm modules to install bootstrap

I am getting errors when using bootstrap stylesheets from npm

Environment

  1. Brunch: 2.9.1
  2. Node: 7.0.0
  3. NPM: 3.10.8
  4. Operating system: ubuntu

package.json contents

  "devDependencies": {
    "angularjs-templates-brunch": "^1.0.0",
    "assetsmanager-brunch": "^1.8.1",
    "auto-reload-brunch": "https://github.com/brunch/auto-reload-brunch.git",
    "babel-brunch": "^6.0.6",
    "babel-plugin-transform-async-to-generator": "^6.8.0",
    "brunch": "^2.0.0",
    "chai": "^3.5.0",
    "chai-as-promised": "^6.0.0",
    "clean-css-brunch": "^2.0.0",
    "css-brunch": "^2.6.1",
    "eslint": "^2.13.1",
    "eslint-config-loopback": "^4.0.0",
    "inject-this-brunch": "^4.0.0",
    "javascript-brunch": "^2.0.0",
    "mocha": "^3.1.2",
    "nsp": "^2.1.0",
    "postcss-brunch": "^2.0.5",
    "sass-brunch": "^2.6.3",
    "uglify-js-brunch": "^2.0.0"
  },

my npm section in brunch-config.js is

 npm: {
            enabled: true,

            globals: {
                $: 'jquery'
            },

            styles: {
                bootstrap: ['dist/css/bootstrap.css']
            }
        },

if I exclude the bootstrap key above, bootstrap.css does not get included in vendor.css when I run npm start, I get loads of errors similar to this

13 Nov 16:57:38 - error: Source map generation failed for node_modules/bootstrap/dist/css/less/carousel.less:  ENOENT: no such file or directory, open '/home/ubuntu/workspace/node_modules/bootstrap/dist/css/less/carousel.less'

which is very odd, as there is no less directory in node_modules/bootstrap/dist/css

image

However, despite the errors, the bootstrap.css is included in the vendor.css file

What am I missing / misconfigured ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmlscommented, Nov 24, 2016

worked for me too. thanks a brunch 😉

0reactions
stelmakhcommented, Nov 23, 2016

@jmls try adding this to your brunch-config. This option tells postcss to ignore previously generated source maps. Fixed the issue for me. plugins: { postcss: { map: {prev: false} } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

bootstrap-css - npm
A css module compatible version of bootstrap. ... Start using bootstrap-css in your project by running `npm i bootstrap-css`.
Read more >
Webpack - Bootstrap
Learn how to include Bootstrap in your project using Webpack 3. Installing Bootstrap. Install bootstrap as a Node.js module using npm. Importing JavaScript....
Read more >
Download · Bootstrap v5.0
Download Bootstrap to get the compiled CSS and JavaScript, source code, or include it with your favorite package managers like npm, RubyGems, and...
Read more >
Getting started - Bootstrap
Bootstrap uses Autoprefixer to deal with CSS vendor prefixes. ... install node.js (which includes npm). npm stands for node packaged modules and is...
Read more >
Webpack and bundlers · Bootstrap v5.0
Install bootstrap as a Node.js module using npm. ... { // translates CSS into CommonJS modules loader: 'css-loader' }, { // Run postcss...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found