所以,我有一个包,在这个包里面-lock.json:
"micromatch": {
"version": "2.3.11",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
"integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
"requires": {
"arr-diff": "^2.0.0",
"array-unique": "^0.2.1",
"braces": "^1.8.2",
"expand-brackets": "^0.1.4",
"extglob": "^0.3.1",
"filename-regex": "^2.0.0",
"is-extglob": "^1.0.0",
"is-glob": "^2.0.1",
"kind-of": "^3.0.2",
"normalize-path": "^2.0.1",
"object.omit": "^2.0.0",
"parse-glob": "^3.0.4",
"regex-cache": "^0.4.2"
}
}漏洞是:“花括号”:"^1.8.2",当我运行npm审计时,它说它被修正为2.3.1,但是我似乎无法更新它,或者只是不知道如何更新它。
我尝试过的:
可能有几件事我不理解npm的依赖关系。那我该怎么解决呢?
为package.json编辑
{
"name": "project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^3.9.2",
"@material-ui/icons": "^3.0.2",
"micromatch": "^3.1.10",
"prop-types": "latest",
"react": "^16.8.2",
"react-async-component": "^2.0.0",
"react-dom": "^16.8.2",
"react-scripts": "^2.1.5",
"typeface-roboto": "0.0.54"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"react-router-dom": "^4.3.1"
}
}发布于 2019-02-18 07:44:37
您需要将您的微匹配模块升级到最新版本3.1,该漏洞的出现是因为您正在使用的微匹配2.3.11使用的是旧版本的大括号。支持版本在最新的微匹配版本中升级,所以只需升级您的微匹配模块即可。就能解决你的问题。
为了升级,
当微匹配升级大括号模块- https://github.com/micromatch/micromatch/commit/cdff648d3f50f2f6342c7f23c899f95d8244b144时,请参见此提交。
https://stackoverflow.com/questions/54740101
复制相似问题