错误:ENOENT:没有这样的文件或目录,lstat

时间:2019-06-22 22:44:16

标签: node-sass

我无法将.scss文件从一个目录移植到.css中的另一个目录。我所有的文件夹层次结构都是相同的,不应出现此文件位置问题。

$ node-sass -w -r -i /build/scss/pages/index.scss /dist/css/index.min.css --output-style compressed
An output directory must be specified when compiling a directory
An output directory must be specified when compiling a directory
fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, lstat '/build/scss/pages/index.scss'
    at Object.lstatSync (fs.js:840:3)
    at Object.module.exports.parseDir (C:\Users\thiag\Documents\PROJETOS\instagram-clone\node_modules\sass-graph\sass-graph.js:153:10)
    at Object.watcher.reset (C:\Users\thiag\Documents\PROJETOS\instagram-clone\node_modules\node-sass\lib\watcher.js:17:21)
    at watch (C:\Users\thiag\Documents\PROJETOS\instagram-clone\node_modules\node-sass\bin\node-sass:260:20)
    at run (C:\Users\thiag\Documents\PROJETOS\instagram-clone\node_modules\node-sass\bin\node-sass:319:5)
    at Object.<anonymous> (C:\Users\thiag\Documents\PROJETOS\instagram-clone\node_modules\node-sass\bin\node-sass:405:3)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

在可视代码工作室中复制路径的文件夹目录如下:

build --> root
dist --> root
package.json --> root

build\scss\pages\_index.scss
dist\css

1 个答案:

答案 0 :(得分:0)

发生的问题如下:

SASS无法读取“下划线” 文件,例如_index.scss。因此,为解决此问题,我删除了“下划线”

另一种方法是创建一个文件,例如.scss,另一个文件是_arquivo2.scss.scss文件将包含@import中的_file2.scss