postcss / postcss-cli

CLI for postcss
Other
840 stars 93 forks source link

npm script: [object Object] is not a PostCSS plugin #346

Closed dmuy closed 4 years ago

dmuy commented 4 years ago

Hi,

I have a problem on the above subject. I'm using postcss-cli together with autoprefixer and cssnano.

I run this script:

"css-prefix": "postcss dist/mdtoast.css -u autoprefixer -o dist/mdtoast.css"

And I get this error:

Error: [object Object] is not a PostCSS plugin
    at Processor.normalize (C:\Projects\plugins\toast\node_modules\postcss\lib\processor.js:168:15)
    at new Processor (C:\Projects\plugins\toast\node_modules\postcss\lib\processor.js:52:25)
    at postcss (C:\Projects\plugins\toast\node_modules\postcss\lib\postcss.js:55:10)
    at C:\Projects\plugins\toast\node_modules\postcss-cli\index.js:216:14

This error is only for autoprefixer, there's no problem with cssnano

RyanZim commented 4 years ago

postcss-cli is in the process of upgrading to postcss v8, but it isn't out yet. AFAIK, cssnano hasn't upgraded yet. For now, you'll need to pin to an older version of autoprefixer that uses postcss v7.

mangelozzi commented 4 years ago

In the mean time I used npm install autoprefixer@9.8.6