scss呈现错误[内部错误:找不到要读取的文件或不可读的文件:] [英] scss rendering error [Internal Error: File to read not found or unreadable:]

查看:36
本文介绍了scss呈现错误[内部错误:找不到要读取的文件或不可读的文件:]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用scss创建一个网站,但是当我保存scss文件时,它给了我一个错误.但是,如果我保存了几次,它将完全渲染.没什么大不了的,但是让我烦.

I want to make a website with scss but when i save the scss file it gives me an error. However, if I saved it a couple times then it will render completely. Its nothing major but it bugs me.

我尝试在Google中找到答案,但没有任何效果

I tried finding an answer in Google but nothing works

这只是一个简单的scss文件,因为我只是在尝试开始项目之前尝试检查是否有错误.原来那里.

This is just a simple scss file because I am just trying to check if there's an error before i begin my project. turns out there is.

@import "fixed";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #444;
}

{
  "status": 3,
  "message": "File to read not found or unreadable: E:/Coding Stuff/Websites/bs4/scss/main.scss",
  "formatted": "Internal Error: File to read not found or unreadable: E:/Coding Stuff/Websites/bs4/scss/main.scss\n"
}

保存几次后:

=> changed: E:\Coding Stuff\Websites\bs4\scss\main.scss
Rendering Complete, saving .css file...
Wrote CSS to E:\Coding Stuff\Websites\bs4\css\main.css

我做错了什么?请帮助

推荐答案

如果您使用node-sass作为编译器,并且使用vscode或sublime文本AFAIK,则问题在于原子保存选项,其中node-sass无法拥有可以编辑scss文件,因为编辑器仍在忙.解决此问题的两种方法包括:

if you are using a node-sass as the compiler and vscode or sublime text AFAIK, the issue is with atomic save option where node-sass can't have access to transpile the scss file because the editor is still busy with it. Two ways of fixing this include:

  1. 替换 node-sass
  2. 的render.js文件
  1. Replace render.js file of node-sass

此处每次安装node-sass都必须这样做

check here there is a drawback of having to do this everytime you install node-sass

  1. 改为安装 sass 模块

$纱线添加-D sass脚本

$ yarn add -D sass script

$ sass --watch input.scss output.css

$ sass --watch input.scss output.css

这篇关于scss呈现错误[内部错误:找不到要读取的文件或不可读的文件:]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆