αƞjiβ
αƞjiβ

Reputation: 3246

npm install behavior after clear cache vs folder delete

I am trying to understand how npm work on cache clean and installation. Whenever I have to get latest latest version I try to do:

$ npm cache clean
$ npm install

But it fails to pickup latest dependencies so I always have to do delete old dependent project folder from node_module folder and do npm install

So I want to understand why?

Upvotes: 1

Views: 1279

Answers (1)

Jazz
Jazz

Reputation: 5917

npm cache clean only purges the global cache npm uses to avoid re-downloading the same packages. npm install does nothing if the installed package versions match the versions in package.json.

Maybe the command you're looking for is npm update?

Upvotes: 1

Related Questions