Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Chron's avatar
Level 6

How to downgrade a package in npm?

I want to downgrade moment2.24.0 to 2.22.2 because of conflict with other package. Moment is already installed when I did npm run install so I'm hesitating, I may break the system.

0 likes
1 reply
Chron's avatar
Chron
OP
Best Answer
Level 6
npm install <package>@<version>

removes the current version and replaces it by the newly installed version

Please or to participate in this conversation.