【发布时间】:2020-05-15 13:03:11
【问题描述】:
我成功安装了 autoprefixer 和 postcss-cli。我正在尝试使用我的命令提示符和 VS 代码“使用 NPM 脚本设置简单的构建过程”。我正在观看有关 CSS/SASS 主题的教程,因为我只有 2 个月的编码经验并且不太了解如何调试。我完成了我想要的代码,现在我正在尝试将所有内容编译成一个压缩的 style.css 文档......我成功地连接了所有内容,但现在我遇到了前缀问题。
在命令提示符中,我正在输入:npm run prefix:css,它正在运行此脚本:
postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css
我明白了:
TypeError: Patterns must be a string or an array of strings
at assertPatternsInput (C:\Users\mjpry\Desktop\advanced-css-course master\Natours\starter\node_modules\globby\index.js:17:9)
at generateGlobTasks (C:\Users\mjpry\Desktop\advanced-css-course-master\Natours\starter\node_modules\globby\index.js:42:2)
at module.exports (C:\Users\mjpry\Desktop\advanced-css-course-master\Natours\starter\node_modules\globby\index.js:116:20)
at C:\Users\mjpry\Desktop\advanced-css-course-master\Natours\starter\node_modules\postcss-cli\index.js:59:14
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! natours@1.0.0 prefix:css: `postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the natours@1.0.0 prefix:css 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! C:\Users\mjpry\AppData\Roaming\npm-cache\_logs\2020-01-29T23_00_22_951Z-debug.log
就像我说的......没有足够的经验来解决这个问题。我怀疑这不是 Node_Modules 的问题,就像这个错误似乎正在捕获的那样......但我不知道该怎么做。请帮忙!
【问题讨论】:
-
欢迎来到 Stackoverflow!这回答了你的问题了吗? Autoprefixer in npm script show TypeError: Patterns must be a string or an array of strings
标签: css npm sass postcss autoprefixer