phpstorm postcss-cli autoprefixer Input Error: You must pass a valid list of files to parse

phpstorm或者webstorm配置autoprefixer的教程,百度即可

开始吹牛逼

使用postcss+autoprefixer压缩文件时候,提示:

Input Error: You must pass a valid list of files to parse

查看postcss和autoprefixer代码也没看出个所以然,

网上查也查不到,

去年我就配置过一次了,但是去年没遇到任何问题,由于今年把电脑系统重装了,于是乎,出现了问题,我就放弃了,

这两天,又重新拾起这个问题,觉得不能被这个问题给困住,

于是,我继续研究

经过我许久的研究,最终解决掉这个问题,

我在postcss/autoprefixer的github里再次仔细查看的时候,因为我已经看过很多遍了,突然注意到这么一个问题,

Version 10 doesn’t work in PostCSS 7

于是,进去仔细查看,在一个回答里看到:

大概意思就是说,PostCSS 7 不支持 autoprefixer 8以上的版本.

Right now we have a clear error message PostCSS 7 do not support PostCSS 8 plugin autoprefixer. Downgrade it or update PostCSS. I think it is enough. It is better to spend a day and help postcss-cli team to get an update.

那就清楚了,于是把postcss和autoprefixer版本分别安装低版本测试,

既然我去年postcss安装没问题,那就安装2019的版本,

我测试了几个版本,选来选去,最终选择了如下:

我目前的安装的版本

postcss-cli@6.1.3

autoprefixer@9.8.6

具体操作

安装Autoprefixer@9.8.6

npm install autoprefixer@9.8.6 -g

安装 postcss-cli@6.1.3

npm install postcss-cli@6.1.3 -g

如有意外请拨打114

吹牛结束

参考:

https://github.com/postcss/postcss-cli

https://github.com/postcss/autoprefixer

https://github.com/postcss/autoprefixer/issues/1359

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注




Enter Captcha Here :