npx npm-force-resolution报错


{
  "name": "node",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "preinstall": "npx npm-force-resolutions",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "resolutions": {
    "html-webpack-plugin": "4.5.2"
  },
  "dependencies": {
    "sass": "^1.58.3",
    "scss": "^0.2.4",
    "html-webpack-plugin": "4.5.2"
  }
}

执行install的时候有这个报错,有没有遇见同样问题的

D:\item\1122\node>npm install

> node@1.0.0 preinstall D:\item\1122\node
> npx npm-force-resolutions

npx: installed 6 in 3.588s
command not found: npm-force-resolutions
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node@1.0.0 preinstall: `npx npm-force-resolutions`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node@1.0.0 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

看起来是 npm-force-resolutions 命令没有被正确安装,所以执行 npx npm-force-resolutions 时找不到对应的命令,导致了报错。
可以尝试重新安装 npm-force-resolutions

npm install -g npm-force-resolutions