Postcss-cli cannot find flexbugs-fixes module (finds autoprefixer with no problems though)
Asked Answered
C

1

5

I installed postcss-cli autoprefixer and postcss-flexbugs-fixes in my project via npm. There were unmet dep warnings for pff but it did install. I know my postcss and cli is working because when I run

postcss --use autoprefixer index.scss

from terminal it works just fine - i have some dummy css in there anyway just to rule out syntax errors.

When I run

postcss --use postcss-flexbugs-fixes index.scss

I get an error saying cannot find module postcss-flexbugs-fixes. It's probably worth mentioning I'm on node 4.4.5 but I've had postcss-flexbugs-fixes work before on this version of node, the only difference (including version numbers) being it was wrapped inside a gulp task. Here is the full error:

Error: Cannot find module 'postcss-flexbugs-fixes'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at /Users/ohu275/.nvm/versions/node/v4.4.5/lib/node_modules/postcss-cli/index.js:107:14
at Array.map (native)
at Object.<anonymous> (/Users/ohu275/.nvm/versions/node/v4.4.5/lib/node_modules/postcss-cli/index.js:100:24)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)

I'm ultimately trying to get to a point where I can run my postcss tasks via an npm build script. I've got autoprefixer working but no dice with the flexbugs-fixes via postcss-cli. I have to think I'm doing something wrong because I've had this particular plugin work before, just not with the cli. Other plugins are working with my cli. Any help would be much appreciated.

Cleon answered 16/11, 2016 at 4:29 Comment(2)
You have npm install'd postcss-flexbugs-fixes, right?Matrilocal
yeah - i have it installed locally. it will work if install it with the global flag, but that shouldn't be necessary, right?Cleon
T
13
npm install -D postcss-flexbugs-fixes  

and

npm install -D postcss-preset-env   
Towards answered 1/1, 2022 at 10:49 Comment(3)
In my case, just installing postcss-flexbugs-fixes addressed the issueSubstitute
In my case, I needed both.Pazit
love <3 love <3 love <3 love <3 love <3 love <3 love <3 love <3Parke

© 2022 - 2024 — McMap. All rights reserved.