Tag Archives: Web end+HTML+CSS

[Solved] Syntax Error: Error: Loading PostCSS Plugin failed: Cannot find module ‘autoprefixer‘

1. Errors occurred:

1. Code display

E:\librarycat\admin>npm run serve

> [email protected] serve E:\softwork\Practice_Yg\daiding\librarycat\admin
> vue-cli-service serve

 INFO  Starting development server...
98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 error                                                                                                       下午2:51:47

 error  in ./src/App.vue?vue&type=style&index=0&lang=scss&

Syntax Error: Error: Loading PostCSS Plugin failed: Cannot find module 'autoprefixer'
Require stack:
- E:\softwork\Practice_Yg\daiding\librarycat\admin\noop.js

(@E:\softwork\Practice_Yg\daiding\librarycat\admin\package.json)
    at Array.map (<anonymous>)


 @ ./node_modules/@vue/cli-service/node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/@vue/cli-service/node_modules/css-loader??ref--8-oneOf
-1-1!./node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/
src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??re
f--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=style&index=0&lang=scss& 4:14-563 15:3-20:
5 16:22-571
 @ ./src/App.vue?vue&type=style&index=0&lang=scss&
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.0.145:8081/sockjs-node (webpack)/hot/dev-server.js ./src/main.js


2. Picture presentation questions:


2. Problem-solving process

1. In package.json file

Delete the following

  "postcss":{
    "plugins":{
      "autoprefixer": {}
    }
  },

2. Add a sentence to main.js

import 'amfe-flexible'

3. comment out the codes below: