当使用node-sass运行grunt-sass时,无法编译scss文件,声称该文件不存在或不可读,但对用户而言是可读的。
Registering Gruntfile tasks.
Initializing config...OK
Registering "tasks" tasks.
>> Tasks directory "tasks" not found.
Registering "grunt-contrib-concat" local Npm module tasks.
Reading /var/www/wm-op-test/themes.src/wm_onepager.src/node_modules/grunt-contrib-concat/package.json...OK
Parsing /var/www/wm-op-test/themes.src/wm_onepager.src/node_modules/grunt-contrib-concat/package.json...OK
Loading "concat.js" tasks...OK
+ concat
Registering "grunt-contrib-watch" local Npm module tasks.
Reading /var/www/wm-op-test/themes.src/wm_onepager.src/node_modules/grunt-contrib-watch/package.json...OK
Parsing /var/www/wm-op-test/themes.src/wm_onepager.src/node_modules/grunt-contrib-watch/package.json...OK
Loading "watch.js" tasks...OK
+ watch
Registering "grunt-sass" local Npm module tasks.
Reading /var/www/wm-op-test/themes.src/wm_onepager.src/node_modules/grunt-sass/package.json...OK
Parsing /var/www/wm-op-test/themes.src/wm_onepager.src/node_modules/grunt-sass/package.json...OK
Loading "sass.js" tasks...OK
+ sass
Loading "gruntfile.js" tasks...OK
+ default
Running tasks: sass
Running "sass" task
Running "sass:compile" (sass) task
Verifying property sass.compile exists in config...OK
Files: sass/base, sass/components, sass/config, sass/layout, sass/theme -> build/css/style.css
Options: precision=10, implementation={"info":"node-sass\t4.9.3\t(Wrapper)\t[JavaScript]\nlibsass \t3.5.4\t(Sass Compiler)\t[C/C++]","types":{},"TRUE":{},"FALSE":{},"NULL":{}}
node-sass 4.9.3 (Wrapper) [JavaScript]
libsass 3.5.4 (Sass Compiler) [C/C++]
Fatal error: File to read not found or unreadable: /var/www/projectthemes.src/pager.src/sass/base
Completed in 0.762s at Wed Sep 19 2018 08:30:41 GMT+0200 (Central European Summer Time) - Waiting...
/var/www/projectthemes.src/pager.src/sass/base在此并且对用户可读。我不明白为什么会出现此错误,这完全没有任何意义。 sass / base不是文件,是目录,可以使用。它也没有告诉我确切没有什么文件。
ls -la /var/www/projectthemes.src/pager.src/sass/
total 28
drwxr-xr-x 7 user sudo 4096 Sep 14 11:10 .
drwxr-xr-x 10 user sudo 4096 Sep 19 08:29 ..
drwxr-xr-x 2 user sudo 4096 Sep 19 08:30 base
drwxr-xr-x 2 user sudo 4096 Sep 14 11:10 components
drwxr-xr-x 2 user sudo 4096 Sep 14 11:10 config
drwxr-xr-x 2 user sudo 4096 Sep 17 16:05 layout
drwxr-xr-x 2 user sudo 4096 Sep 14 11:10 theme