fix: strip non-ansi characters from registry config (#5808)

To deal with malformed stdout result retrieved from child processes.

Fixes #5802
This commit is contained in:
Haoqun Jiang
2020-08-24 15:52:37 +08:00
committed by GitHub
parent 5d002ccb07
commit 27db6bfaa8
2 changed files with 4 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ const ini = require('ini')
const minimist = require('minimist')
const LRU = require('lru-cache')
const stripAnsi = require('strip-ansi')
const {
chalk,
execa,
@@ -152,6 +154,7 @@ class PackageManager {
}
}
this._registry = stripAnsi(this._registry).trim()
return this._registry
}

View File

@@ -55,6 +55,7 @@
"resolve": "^1.17.0",
"shortid": "^2.2.15",
"slash": "^3.0.0",
"strip-ansi": "^6.0.0",
"validate-npm-package-name": "^3.0.0",
"vue": "^2.6.11",
"vue-codemod": "^0.0.4",