twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.9k stars 78.89k forks source link

Build fails with "An output directory must be specified when compiling a directory" #25156

Closed robogeek closed 6 years ago

robogeek commented 6 years ago

The issue at hand is running a build of Bootstrap after installing it as an npm package. Most of the verification queries (below) are not applicable. There appears to be a bug in the build process.

OS: macOS 10.11.6 ... Node.js 8.9.1

I have an Express app, and have installed Bootstrap as a package.json dependency. I want to produce a modified Bootstrap build and at the moment have made zero modifications.

$ (cd node_modules/bootstrap/; npm install)

This gets the dependencies installed in the Bootstrap package. This took a long time to run.

$ (cd node_modules/bootstrap/; npm run dist)

This attempts to build Bootstrap. The build proceeds fine until this step:

> bootstrap@4.0.0-beta.2 css-compile-docs /Volumes/Drobo5N/drb142101a00015/1/David/NodeWebDevelopment/book-rev4/code/chap06/notes/node_modules/bootstrap
> node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 assets/scss/docs.scss assets/css/docs.min.css

An output directory must be specified when compiling a directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap@4.0.0-beta.2 css-compile-docs: `node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 assets/scss/docs.scss assets/css/docs.min.css`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bootstrap@4.0.0-beta.2 css-compile-docs script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It appears from the error message that node-sass wants a -o directory option. HOWEVER, the command line is not trying to compile a directory, instead it lists an input file and an output file.

In other words, I suspect an error in using the node-sass command in the package.json scripts ...?

Your Verification questions

Before opening an issue:

When asking general "how to" questions:

When reporting a bug, include:

When suggesting a feature, include:

wolfy1339 commented 6 years ago

How-to questions are to be posted on Stack overflow. As this problem doesn't happen on vanilla bootstrap, it is invalid

robogeek commented 6 years ago

Um... what do you mean "vanilla bootstrap". If you mean that build only works with the download then tell me that. This "vanilla bootstrap" phrase seems to add confusion -- because the npm package is pretty darn vanilla.

wolfy1339 commented 6 years ago

The build tools only work properly from a git clone or tarball.

srad commented 6 years ago

This is seriously closed? When I install b4 via npm I can't run a build and this is considered as acceptable? Then why did it worked with all earlier versions, beside all future wtf experiences for everybody.

robogeek commented 6 years ago

As the original poster ... I did consider making the complaint you just said. However it is straightforward to build from a clone of the git repository.

I'm working on the 4th edition of Node.js Web Development. In the 3rd edition I showed how to build the Bower repository - I think it hadn't been added to npm at that time. For the 4th edition I started to replicate the instructions from the 3rd edition, and ran into problems as I noted above.

So, yeah, someone who'd done a build of bootstrap3 from npm WOULD be disappointed (or maybe even WTF'd) by being unable to build bootstrap4.

mdo commented 6 years ago

@srad I missed this issue, but there are additional ones where this is explained (as well as in our release blog posts and migration docs). Typically, npm packages don't include a separate build system as package management is meant to integrate packages into your own asset pipeline or build system. Including it for everyone made it half broken (we weren't including all the required files for it) and made the call to rip it all out rather than try to support a fragile and uncommon workflow

Hope that helps some.