Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node-sass: File to import not found or unreadable: ./node_modules/

This is my project files/folders structure:

myproject/
  themes/
    mytheme/
      .node_modules/
      source/
        css/
          mytheme.sass
      _config.yml
      package.json

So, I modified my myproject/themes/mytheme/source/css/mytheme.sass file in order to import two node_modules/ packages:

@import "./node_modules/minireset.css/minireset.sass"
@import "./node_modules/components-font-awesome/scss/font-awesome"

But when I execute hexo server and I navigate through my localhost server, I got this error message in Terminal:

Error: File to import not found or unreadable: ./node_modules/minireset.css/minireset.sass.
Error: File to import not found or unreadable: ./node_modules/components-font-awesome/scss/font-awesome.

So, how should I import these packages into my main SASS file? I'm using hexo-renderer-sass (https://github.com/knksmith57/hexo-renderer-sass).

Regards.

like image 613
Jonathan Avatar asked Nov 21 '17 14:11

Jonathan


1 Answers

The path to your sass files has to be relative to the current sass file:

@import "../../node_modules/minireset.css/minireset.sass"
@import "../../node_modules/components-font-awesome/scss/font-awesome"
like image 145
klugjo Avatar answered Nov 03 '22 00:11

klugjo