How to fix npm vulnerabilities manually?

后端 未结 4 815
臣服心动
臣服心动 2020-12-04 11:58

When I run npm install it says found 33 vulnerabilities (2 low, 31 moderate) run `npm audit fix` to fix them, or `npm audit` for details.

4条回答
  •  难免孤独
    2020-12-04 12:32

    'npm audit fix' will increment the version of dependency in package.json which might lead to breaking of code. So better way is to open package-lock.json and updated the dependency/subdependency versions to required version. Maintain the package-lock.json in repository.

    Sometimes vulnerabilities are from dev packages, In that case ignore those vulnerabilities as those are not getting picked up in the production.

提交回复
热议问题