proxy error: could not proxy request [How to Solve]

Find the vue.config.js file and change the address:

devServer: {
  proxy: {
    '/api': {
      target: "http://localhost:Port number own address", //This replacement is the local address
      changeOrigin: true,
      logLevel: "debug"


vue.config.js   Is an optional configuration file if the project’s (and   package.json   If this file exists in the root directory of the same level, it will be deleted  @ vue/cli-service   Automatic loading. You can also use   package.json   Medium   vue   Field, but note that this writing method requires you to strictly follow the JSON format.

Create in root directory: vue.config.js

Read More: