Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: EACCES, mkdir '/sc5styleguide' Error: We need tree to translate #477

Closed
alanontheweb opened this issue Feb 13, 2015 · 13 comments
Closed

Comments

@alanontheweb
Copy link

What does this mean? It was working but stopped after a gulp update. Not sure if it's related to 3.6 or something else.

Also, sass interpolation breaks gonzales-pe.

@jpbackman
Copy link
Contributor

@alanontheweb could you provide a bit more details about when this error is thrown, i.e. during installation, styleguide.generate() or styleguide.applyStyles(), or perhaps somewhere else?

@alanontheweb
Copy link
Author

@jpbackman Sure, here you go -

Running 'styleguide'...
[23:56:10] Using gulpfile ~/Documents/Projects/demosite/gulpfile.js
[23:56:10] Starting 'styleguide:generate'...
[23:56:10] Starting 'styleguide:applystyles'...
[23:56:10] Finished 'styleguide:applystyles' after 193 ms
[23:56:10] 'styleguide:generate' errored after 210 ms
[23:56:10] Error: EACCES, mkdir '/sc5styleguide'
Error: We need tree to translate

@jpbackman
Copy link
Contributor

Hmm, haven't seen that error message before, but to me it looks like something (gulp, I assume) is trying to create a dir /sc5styleguide at your root, are you sure you want that? Check the path you're passing on to gulp.dest().

Also, I'd guess that the EACCES error is from gulp trying to mkdir at root, and the other error message is unrelated to that, and comes probably from the sass preprocessor you're using, it's definitely not something we'd throw.

@alanontheweb
Copy link
Author

@jpbackman Ahh thanks. It's my first time using this, so I wouldn't be sure. But I got it to compile by setting "return gulp.src('[asterisk].scss')" instead of a path or with "[asterisk|asterisk] / [asterisk].scss".

However, it doesn't seem to be picking up my KSS annotations. The server loads but it just shows the readMe. I copied the KSS comments right out of the demo files. What could I be missing?

@jpbackman
Copy link
Contributor

gulp.src picks the files relative to the gulpfile.js, and .scss matches only a file with exactly that name, since you don't provide a wildcard (i.e. *). If you have your .scss files in css dir, you'd use gulp.src('css/*.scss'), and 'css/**/*.scss' would match all .scss files in css and its subdirs.

@alanontheweb
Copy link
Author

No, I get that. I know gulp, just having issues with getting sc5 to compile right. The paths and wildcards throw up that error tree. I'm going to dig up the gulp demo file you guys provided. Maybe my config is off.

@alanontheweb
Copy link
Author

I think it looks the same... I only removed the node-neat stuff. This throws the error - Error: We need tree to translate

// generate(): All unprocessed styles containing the KSS markup and style variables. This will process the KSS markup and collects variable information.
gulp.task('styleguide:generate', function() {
  return gulp.src('src/assets/**/*.scss')
    .pipe(styleguide.generate({
        title: 'CNC Styleguide',
        server: true,
        port: 9000,
        rootPath: env.Test + "sc5styleguide",
        //styleVariables: 'lib/app/sass/_styleguide_variables.scss'
        overviewPath: 'README.md'
      }))
    .pipe(gulp.dest(env.Test + "sc5styleguide"));
});

//applyStyles(): Preprocessed/compiled stylesheets. This will create necessary pseudo styles and create the actual stylesheet to be used in the styleguide.
gulp.task('styleguide:applystyles', function() {
  return gulp.src('main.scss')
    .pipe($.sass({
      errLogToConsole: true
    }))
    .pipe(styleguide.applyStyles())
    .pipe(gulp.dest(env.Test + "/sc5styleguide"));
});

gulp.task('watch', ['styleguide'], function() {
  // Start watching changes and update styleguide whenever changes are detected
  // Styleguide automatically detects existing server instance
  gulp.watch(['*.scss'], ['styleguide']);
});

gulp.task('styleguide', ['styleguide:generate', 'styleguide:applystyles']);

@jpbackman
Copy link
Contributor

Could you paste the output of npm ls --depth 0? I'll try to replicate this on my end and find the root cause.

@alanontheweb
Copy link
Author

Okay, so it is a 0.3.6 thing, at least for me. I reverted to 0.3.5 and now I'm getting these errors (but at least it's going through my file).

Parsing error: Please check the validity of the block starting from line #206

204 | table tr th.show-for-small, table tr td.show-for-small {
205 |
206*| @media #{$small-only} {
207 | display:table-cell;
208 | }

Gonzales breaks on sass interpolation. I tried switching back to "gonzales-pe": "3.0.0-12", but now it's giving me this error instead - TypeError: Object # has no method 'parse'

Sure, and from which directory? The root of my project or the root of the sc5 folder?

@jpbackman
Copy link
Contributor

Yes, we reverted our variable parsing related changes and gonzales-pe to an older version with 0.3.6 since they were giving more trouble than benefits, and the newer gonzales-pe has a changed API, so we can't update it without making big rewrites. We'll sit tight for a while and let things settle on that front, sorry.

@sarahquigley
Copy link

Hey @alanontheweb and @jpbackman ,

I noticed this issue, and thought I'd add my voice. I have also come across this error message 'Error: We need tree to translate'.

For me, this error has been always caused (so far a least) by a simple issue in my SCSS code as shown in the example below:

@mixin sample-mixin($variable:'value'){
...
}

The key thing to note about the example above is that there is no space between $variable and its value. This is the cause of this issue (or has been for me at least).

The issue is resolved simply by adding a space between $variable and its value - as in the code below:

@mixin sample-mixin($variable: 'value'){
...
}

The root cause of this issue is almost certainly not an SC5-styleguide issue, but some issue with one of its dependencies - perhaps this 'gonzales-pe' you mentioned. I haven't taken the time to look into it in any detail, having found this simple fix.

@alanontheweb I'm not sure if this will help you resolve your issue, but I hope it does!

@alanontheweb
Copy link
Author

Thanks @sarahquigley ! I'll take a look see if I find something in my SCSS that matches what you're describing. Much appreciated =)

@sarahquigley
Copy link

@alanontheweb No problem! It took me a while to track down the cause of that issue - so it would be nice to be able to save someone else the trouble - fingers-crossed it's the same cause for you!

@cyberixae cyberixae added the bug label Mar 19, 2015
@cyberixae cyberixae modified the milestone: 0.3.8 Mar 19, 2015
@junaidrsd junaidrsd modified the milestones: Tracking, Focus Apr 7, 2015
hannu pushed a commit to hannu/sc5-styleguide that referenced this issue Jun 4, 2015
hannu pushed a commit to hannu/sc5-styleguide that referenced this issue Jun 4, 2015
hannu added a commit that referenced this issue Jun 8, 2015
Fix SCSS mixing parsing and add tests, fixes #477
@hannu hannu closed this as completed in ce94f11 Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants