自动前缀程序脚本不运行 类型错误:模式必须是字符串或字符串数组



我成功地安装了自动前缀和postcss-cli。我正在尝试使用我的命令提示符和 VS 代码"使用 NPM 脚本设置一个简单的构建过程"。我正在观看有关 CSS/SASS 主题的教程,因为我只有 2 个月的编码经验,还不太了解如何调试。我完成了我想要的代码,现在我正在尝试将所有内容编译为压缩样式.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:UsersmjpryDesktopadvanced-css-course masterNatoursstarternode_modulesglobbyindex.js:17:9)
at generateGlobTasks (C:UsersmjpryDesktopadvanced-css-course-masterNatoursstarternode_modulesglobbyindex.js:42:2)
at module.exports (C:UsersmjpryDesktopadvanced-css-course-masterNatoursstarternode_modulesglobbyindex.js:116:20)
at C:UsersmjpryDesktopadvanced-css-course-masterNatoursstarternode_modulespostcss-cliindex.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:UsersmjpryAppDataRoamingnpm-cache_logs2020-01-29T23_00_22_951Z-debug.log

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

错误屏幕截图

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

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

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

最新更新