Help: No longer found globally installed plugins
Closed this issue · 4 comments
So, I'm resuming my weekend hobby work after very long break. Update everything to the latest, and then I got this error:
Error: Loading PostCSS Plugin failed: Cannot find module 'plugin-name'
.
I installed everything globally: npm i -g ...
, it's really simple setup.
package.json
{
"scripts": {
"build": "postcss input.css -o output.css"
}
}
.postcssrc.json
{
"map": false,
"plugins": {
"postcss-import": {},
"postcss-preset-env": {},
"cssnano": {
"options": {
"safe": false
},
"autoprefixer": {
"add": true
},
"discardComments": {
"removeAll": true
}
}
}
}
What changed? It used to work without problem. I've tried to search, but I couldn't find anything. Only this very same stackoverflow question but unfortunately there is no answer.
Anyone can help me? Thank you.
Installing things globally is a bad practice; you should install everything locally, especially when you're already using an npm script.
Thanks for the advice.
So, it's impossible to make it load global plugins? Can you tell me the latest postcss-cli version that stil uses the old behaviour?
TBH, I never knew it even supported loading global plugins.