我正在学习本地脚本角,以建立移动和网络应用。我使用以下命令创建了一个项目
ng new -c=@nativescript/schematics sass-project --shared --style=scss我的节点版本是14.15.2角版本是11.0.0,npm版本是6.14.9
当我执行命令时
tns run android or tns run ios我收到以下错误
ERROR in ./app.scss Module build failed (from ../node_modules/sass-loader/dist/cjs.js): SassError: Undefined function.
`77 │ $color-brightness: round((red($color) * 299) + (green($color) * 587) + math.div(blue($color) * 114, 1000));
node_modules/@nativescript/theme/scss/mixins/_utilities.scss 77:76 check-contrast()
node_modules/@nativescript/theme/scss/mixins/_utilities.scss 86:49 alternate()
node_modules/@nativescript/theme/scss/variables/_index.scss 56:11 @import
node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import
node_modules/@nativescript/theme/core.scss 8:9 @import
src/_app-common.scss 1:9 @import
src/app.scss 2:9 root stylesheet
@ ../node_modules/@nativescript/webpack/helpers/load-application-css-angular.js 5:49-65 6:47-63
@ ./main.tns.ts我试图清理和重建这个项目,但仍然面临着同样的问题。帮助感激。
发布于 2022-01-15 18:55:48
最后,我可以通过在package.json中添加以下sass依赖项来解决此错误
"sass": "1.34.1",
"sass-loader": "10.1.1",如果您面临任何启动web的问题,然后从package.json中删除节点-sass依赖项。
https://stackoverflow.com/questions/70677425
复制相似问题