Node-sass: Output to file not directory > file

Created on 17 Mar 2016  ยท  4Comments  ยท  Source: sass/node-sass

When running this node-sass --output-style compressed style.scss style.css via npm scripts, I receive the following error: Error: EISDIR: illegal operation on a directory.

If I run with the -o flag, like so: node-sass --output-style compressed style.scss -o style.css, it generates the following:

style.scss
style.css
โ””โ”€โ”€ style.css

Is there anyway to just generate the style.css file within the same directory as the style.scss file? Or am I going to have to move things around in a post hook?

Most helpful comment

Node sass outputs the compiled CSS to stdout. If you want to write to a
file you'll need to pipe the out.

node-sass input.scss > input.css

On Mar 18, 2016 7:29 AM, "Nathan Kleekamp" [email protected] wrote:

When running this node-sass --output-style compressed style.scss style.css
via npm scripts, I receive the following error: Error: EISDIR: illegal
operation on a directory.

If I run with the -o flag, like so: node-sass --output-style compressed
style.scss -o style.css, it generates the following:

style.scss
style.css
โ””โ”€โ”€ style.css

Is there anyway to just generate the style.css file within the same
directory as the style.scss file? Or am I going to have to move things
around in a post hook?

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/sass/node-sass/issues/1415

All 4 comments

Node sass outputs the compiled CSS to stdout. If you want to write to a
file you'll need to pipe the out.

node-sass input.scss > input.css

On Mar 18, 2016 7:29 AM, "Nathan Kleekamp" [email protected] wrote:

When running this node-sass --output-style compressed style.scss style.css
via npm scripts, I receive the following error: Error: EISDIR: illegal
operation on a directory.

If I run with the -o flag, like so: node-sass --output-style compressed
style.scss -o style.css, it generates the following:

style.scss
style.css
โ””โ”€โ”€ style.css

Is there anyway to just generate the style.css file within the same
directory as the style.scss file? Or am I going to have to move things
around in a post hook?

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/sass/node-sass/issues/1415

Yup, I saw that node-sass outputs to stdout in the documentation, but when I try:

"scripts": {
    "scss": "node-sass --output-style compressed style.scss > style.css"
}

or even a more simplified version:

"scripts": {
    "scss": "node-sass style.scss > style.css"
}

It errors out, and I get:

> node-sass style.scss > style.css
sh: style.css: Is a directory

I'm using node-sass 3.4.2 and node 4.2.1. Thanks for your help!

Never mind. I had a style.css directory hanging around the directory from when I was experimenting with the-o flag. Sorry for the confusion. I just noticed it after un-hiding untracked files in Atom -Nathan

That's because you previously created a directory call style.css with the
previous command. Remove that directory and you're set.
On Mar 18, 2016 11:03 PM, "Nathan Kleekamp" [email protected]
wrote:

Yup, I saw that node-sass outputs to stdout in the documentation, but when
I try:

"scripts": {
"scss": "node-sass --output-style compressed style.scss > style.css"
}

or even a more simplified version:

"scripts": {
"scss": "node-sass style.scss > style.css"
}

It errors out, and I get:

node-sass style.scss > style.css
sh: style.css: Is a directory

I'm using node-sass 3.4.2 and node 4.2.1. Thanks for your help!

โ€”
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
https://github.com/sass/node-sass/issues/1415#issuecomment-198324983

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pixelatex picture Pixelatex  ยท  3Comments

m-ret picture m-ret  ยท  4Comments

goseesomething picture goseesomething  ยท  3Comments

primiano picture primiano  ยท  3Comments

cjo2118 picture cjo2118  ยท  3Comments