[Node] Install packages correctly and avoid attacks

Read Dependency Confusion: How I Hacked Into Apple, Microsoft and Dozens of Other Companies

Yarn:

yarn install –immutable --immutable-cache --checkcache

to ensure matching packages are present.

 

Npm:

npm ci

to install matching packages without performing any upgrades.

 

Check NPM Scope.

And private package.

 

posted @ 2021-02-15 23:27  Zhentiw  阅读(72)  评论(0)    收藏  举报