掉坑日记01When `proxy` in package.json is an object, each `context` object must have a `target` property

  • Post author:
  • Post category:其他


When

proxy

in package.json is an object, each

context

object must have a

target

property specified as a url string

		PS C:\Users\T440P\Desktop\wang_zzzspark\uip-frontend> npm run serve

> vue-antd-project@1.0.0 serve C:\Users\T440P\Desktop\wang_zzzspark\uip-frontend

 INFO  Starting development server...
When `proxy` in package.json is an object, each `context` object must have a `target` property specified as a url string
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-antd-project@1.0.0 serve: `vue-cli-service serve --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-antd-project@1.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\T440P\AppData\Roaming\npm-cache\_logs\2021-01-11T00_49_23_552Z-debug.log

今天早上启动项目的时候,发现了这样的报错,习惯以为是项目多了新的安装包,但是

npm install

之后还是看错,细细一看报错是再

vue.config.js

里的

proxy

,发现了自己的一个代理端口没开

在这里插入图片描述

打开一行target就好了。



版权声明:本文为neverlandkk原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。