正如我在评论中发布的那样,color.js
&faker.js
包的开发者故意破坏了他的包:https ://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-break-数以千计的应用程序/
live-server
取决于颜色包:"colors": "latest",
如果您查看 package.json,您可以看到这一点
{
"name": "live-server",
"version": "1.2.1",
"description": "simple development http server with live reload capability",
"keywords": [
"front-end",
"development",
"tool",
"server",
"http",
"cli"
],
"author": "Tapio Vierros",
"dependencies": {
"chokidar": "^2.0.4",
"colors": "latest",
"connect": "^3.6.6",
"cors": "latest",
"event-stream": "3.3.4",
"faye-websocket": "0.11.x",
"http-auth": "3.1.x",
"morgan": "^1.9.1",
"object-assign": "latest",
"opn": "latest",
"proxy-middleware": "latest",
"send": "latest",
"serve-index": "^1.9.1"
},
"devDependencies": {
"eslint": "^5.9.0",
"jshint": "^2.9.6",
"mocha": "^5.2.0",
"supertest": "^3.3.0"
},
"scripts": {
"lint": "eslint live-server.js index.js",
"hint": "jshint live-server.js index.js",
"test": "mocha test --exit && npm run lint"
},
"bin": {
"live-server": "./live-server.js"
},
"repository": {
"type": "git",
"url": "https://github.com/tapio/live-server.git"
},
"engines": {
"node": ">=0.10.0"
},
"preferGlobal": true,
"license": "MIT",
"eslintConfig": {
"env": {
"node": true
},
"rules": {
"quotes": 0,
"curly": 0,
"strict": 0,
"no-process-exit": 0,
"eqeqeq": 1,
"no-unused-vars": 1,
"no-shadow": 1
}
}
}
有关 color.js 的更多信息:https ://github.com/Marak/colors.js/issues/285
live-server
可以在这里找到修复: https ://github.com/Marak/colors.js/issues/285#issuecomment-1007890688
只需将其设置为旧版本即可。
Live Server 的 package.json 已将 Colors.js 设置为使用最新的可用版本,因此我将其更改回没有问题的最新 Colors.js 版本 1.4.0。