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.

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

See original GitHub issue

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:

  • Operating system and version (Windows, Mac OS X, Android, iOS, Win10 Mobile)
  • Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
  • Reduced test cases and potential fixes using CodePen or JS Bin

When suggesting a feature, include:

  • As much detail as possible for what we should add and why it’s important to Bootstrap
  • Relevant links to prior art, screenshots, or live demos whenever possible

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
wolfy1339commented, Dec 31, 2017

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

3reactions
wolfy1339commented, Jan 1, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

File watcher: "An output directory must be specified when ...
The scss file I want the file watcher to watch is placed at the root of my project. Watch the error appear: gif_link....
Read more >
Error While Compiling: An Output Directory Must Be Specified
the error message "An output directory must be specified when compiling a directory" is given by node-sass if its input file doesn't exist...
Read more >
Compiling Sass code in VS code using node-sass - HTML-CSS
Note: If your build fails or you see an error message such as “An output directory must be specified when compiling a directory”, ......
Read more >
How do you set a default output-directory? - TeX
I use to put all files that are generated by compiler in a folder called build with the instruction. pdflatex -output-directory=build ...
Read more >
SCSS file watcher output directory
Want to compile main.scss in the sass directory to a file of the same name in the css directory. When I use the...
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