Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
Module build failed: error: no postcss config found in: NPM
The solution you are looking for on the Internet should mention the problem of the webpack version. Don’t think that when you upgrade the webpack version, some modules can’t keep up with the pace of upgrade, or they may not be updated, which leads to you upgrading the webpack and can’t find the configuration of postcss<
at present, the configuration of postcss found on NPM is webpack.config.js,
postcss.config.js is a special processing for webpack 3.0
Scene
I use Vue cli
to create a project, and then if I want to change places, I just add node_ All files other than modules
are copied to another file, and then transferred to GIT. You can re NPM run dev
as you want. However, it can be displayed normally in the original location, but in the new file, it will report an error module build failed: error: no postcss config found in:/users/* *
, which is very embarrassing
Solution
I checked the information on the Internet and said:
You need to create a new file postcss. Config. JS
in the root file and add the following code:
module.exports = {
plugins: {
'autoprefixer': {browsers: 'last 5 version'} } }
1
2
3
4
5
then npm run dev
.
Similar Posts:
- Resolve no postcss config found error
- Cannot findmodule’webpack-cli/bin/config-yargs
- Webpack packaging error: cannot find module ‘webpack / bin / config yargs’ error reason, [email protected] Step on the pit~
- [Solved] [email protected] Error: Cannot find module ‘webpack/bin/config-yargs‘
- [Solved] NPM installation error: error: eacces: permission denied
- [Solved] Vue Syntax Error: Error: PostCSS plugin postcss-pxtorem requires PostCSS 8. -rem Layout
- Error: exec npm config get prefix ERROR: Command failed: npm config get prefix [How to Solve]
- Webpack reports an error when using the cleanwebpackplugin plug-in
- After NPM downloads a vuelazload, swipwe reports an error [Solved]
- [Solved] Vue Install Less Error: npm ERR! code ERESOLVE