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 when attempting to build styleguide #22

Closed
faceleg opened this issue Nov 8, 2015 · 8 comments
Closed

Error when attempting to build styleguide #22

faceleg opened this issue Nov 8, 2015 · 8 comments
Labels

Comments

@faceleg
Copy link

faceleg commented Nov 8, 2015

Is there something I'm missing?

  gulp.task('css', function() {
    return gulp.src('css/core.css')
      .pipe(postcss([
        require('postcss-import')({
          path: __dirname + '/css/'
        }),
        require('postcss-nested')(),
        require('postcss-extend')(),
        require('postcss-simple-vars')(),
        require('postcss-calc')(),
        require('postcss-color-function')(),
        require('autoprefixer')(),
        require('lost')(),
        require('postcss-at2x')(),
        require('postcss-style-guide')({
          showCode: true,
          name: '66pix',
          dir: 'styleguide'
        })
      ]))
      .pipe(gulp.dest('public/css'));
  });

[19:47:18] Error: ENOENT: no such file or directory, open '/Users/faceleg/Sync/faceleg/Work//services/web-frontend/node_modules/postcss-style-guide/node_modules/psg-theme-default/template.ejs'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at /Users/faceleg/Sync/faceleg/Work//services/web-frontend/node_modules/postcss-style-guide/index.js:34:27
at creator (/Users/faceleg/Sync/faceleg/Work//services/web-frontend/node_modules/postcss/lib/postcss.js:60:39)
at Function.postcss.plugin (/Users/faceleg/Sync/faceleg/Work//services/web-frontend/node_modules/postcss/lib/postcss.js:66:23)
at Object. (/Users/faceleg/Sync/faceleg/Work//services/web-frontend/node_modules/postcss-style-guide/index.js:12:26)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)

@matype matype added the bug label Nov 9, 2015
@watilde
Copy link
Contributor

watilde commented Nov 9, 2015

Hi morishi,

As you might have already known, this problem seems related to a flat node_modules in npm v3. This means it should not to depend a simple path as a string like here because now it couldn't be sure where is the child module in whether same directory or parent directory or the other case or not.
Here is a one of the simple solution. Adding a index.js file in the default theme module to return something like a __dirname or a style string. https://github.com/morishitter/psg-theme-default/compare/master...watilde:feature/return-path?expand=1

Thanks!

@matype
Copy link
Owner

matype commented Nov 9, 2015

@watilde Thank you for your advice! I will learn npm v3 in your awesome slides :)

@matype
Copy link
Owner

matype commented Nov 9, 2015

@faceleg Please update postcss-style-guide to v0.9.1.

@faceleg
Copy link
Author

faceleg commented Nov 9, 2015

Will do, thanks!

@faceleg
Copy link
Author

faceleg commented Nov 9, 2015

Hilariously, this failed for me just when I was demoing it to a fellow programmer.

@faceleg
Copy link
Author

faceleg commented Nov 9, 2015

Finally, can I please have a link to the slides?

@watilde
Copy link
Contributor

watilde commented Nov 9, 2015

@morishitter Oh you also need to take in this patch to use the index.js in the default theme module we just added. Let me know if you have any questions Thanks for your time!

@matype matype closed this as completed in #23 Nov 9, 2015
@matype
Copy link
Owner

matype commented Nov 9, 2015

@watilde Thanks for your PR :)

@faceleg Sorry for my bad, I just released v0.9.2. Please update to the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants