Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS to Sass Installing Sass and Setting up the Project The --watch Command

Issue with --watch command

It seems I am not the only one having this problem, and I have checked through other answers online, but can't seem to fix my problem. I am on Windows 10.

I have ensured the file extension is scss, and all files are in the correct places, at the correct levels.

I start with cd "file location path", (hit enter) then sass --watch scss:css as instructed to do so in the video.

All I get is: 'Sass is watching for changes. Press Ctrl-C to stop. error No such file or directory @ rb_sysopen - scss

I have no idea what to do now. I have even uninstalled, and reinstalled the files. Saved them in a different location. And restarted the command window.

Help please!

Clare A
Clare A
23,994 Points

You mentioned checking that the file extension is scss but is the folder named 'scss' and is it at the root? (sounds basic I know but I got the same error when running watch command from the wrong subdirectory)

Hi Clare

It is easy to miss the basic things sometimes! Yes, the folder is named scss and it is on the same level as the css folder. Basically my set up looks the same as in the video.

Thank you for your response, I appreciate the suggestion.

1 Answer

Okay, so let's say you have some project you want to convert. Let's say you will put it in on the desktop, in your My Projects file. For the sake of the explanation, and better organization, we will use another folder with the project Lake Tahoe we made before.

STEP #1 - Open Command Prompt, Run it as Administrator (at least I am doing that way).

STEP #2- Type after C:\WINDOWS\system32> the following:

C:\WINDOWS\system32> cd C:\Users\(Name of User)\Desktop\MyProjects\lake-tahoe\

Hit enter. This step should lead you to the root folder of your project inside My Projects folder. If you name it differently, just make sure to copy from the address bar the correct path.

STEP #3 - Type --watch command like this:

sass --watch scss/style.scss:css/style.css

After this step, it could create a cache file where you'll be having the same problem. It's okay to delete it, press CTRL + C in the Command Prompt and retype the --watch command again.

STEP #4 - Change the style.scss file. Add some changes, or just press Space and press CTRL + S. Make sure you're saving a file in SCSS format.

STEP #5 - Command prompt will tell you the following:

>>> Change detected to: scss/style.scss
  write css/style.css
  write css/style.css.map

In your /css folder you will see this files. Leave them as they are, and check if your page is displaying the right way. Double-check, change something, like a h1 font color to some other color to see if everything is working. Be sure to check command prompt if it's doing what it's supposed to do.

I have tried accessing it with:

sass --watch style.scss:style.css 

But it constantly showed me the error No such file or directory @ rb_sysopen - scss error. So I decided to test the other possibilities, and that's the one which works for me. Maybe it's the path name too long, maybe it's something else, but this works for me.

Now after all the frustration, it's time for the sweet part of learning and doing. :)

Hope this will help you.