我最后一次使用它是在上周星期三我作業的時候,它作業得非常好,沒有任何問題。現在我今天回來并想開始它live-server在控制臺中顯示符號,甚至等待 5 分鐘沒有其他任何事情發生。
出現的奇怪的東西
它嘗試使用 powershell 而不是命令提示符。起初它告訴我腳本被禁用,所以我搜索了它,啟用了腳本,然后在命令提示符下發生了完全相同的事情。
我沒有發現任何關于這個奇怪問題的資訊。我什至安裝了它的最舊版本,但沒有任何改變。
就背景關系而言,這個問題不會發生在我的筆記本電腦上,但它會發生在我家里的臺式機上。我的臺式機和辦公電腦在硬體方面都有幾年的歷史,但除了 windows 10 pro 之外再沒有什么不同了。
uj5u.com熱心網友回復:
正如我在評論中發布的那樣,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。
uj5u.com熱心網友回復:
colors.js 是一個安全漏洞,不應再使用。查看 2022 年 1 月的新聞。
我現在使用nozaki-colors https://github.com/RIAEvangelist/nozaki-colors
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/407592.html
標籤:
上一篇:使用Swiftasync、await、@MainActor進行后臺任務的最佳解決方案是什么
下一篇:我收到npmERR!400錯誤請求-獲取https://artifactory.devops."**********"/artifactory/api/npm/npm/npm
