Autoprefixer script doesn't run TypeError: Patterns must be a string or an array of strings

Autoprefixer script doesn't run TypeError: Patterns must be a string or an array of strings

我成功安装了 autoprefixer 和 postcss-cli。我正在尝试 "Set up a simple build process with NPM scripts" 使用我的命令提示符和 VS 代码。我正在观看关于 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\_logs20-01-29T23_00_22_951Z-debug.log

就像我说的....没有足够的经验来开始解决这个问题。我怀疑这不是 Node_Modules 问题,就像这个错误似乎正在捕获的问题......但无论如何我都不知道该怎么做。请帮忙!

Screenshot of errors

如果您正在使用 windows(并且按照路径显示的方式进行),请尝试以下操作:

postcss --use autoprefixer -b \"last 10 versions\" css/style.concat.css -o css/style.prefix.css

发件人:https://github.com/npm/npm/issues/20048