将 SASS 编译为 CSS 时,总是会出现此错误
An output directory must be specified when compiling a directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! natours@1.0.0 compile:sass: `node-sass scss/main.scss css/style.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the natours@1.0.0 compile:sass script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/haq/.npm/_logs/2020-08-27T13_30_14_538Z-debug.log
答案 0 :(得分:2)
正确的语法是node-sass scss/main.scss -o css/styles.css
编辑:
node-sass要求您显式指定输出文件夹/文件,-o
选项位于此处!
解释所有命令:
node-sass
-o
用于指定输出文件夹的选项如果您需要有关node-sass选项的更多信息,请转到他的npm页面,该文件有据可查:https://www.npmjs.com/package/node-sass