Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  43] [ 1]  / answers: 1 / hits: 14952  / 2 Years ago, mon, april 4, 2022, 12:00:00

I am trying to update specific package in my project. I have checked it using npm outdated and then I run this command to update this package: npm update nameofpackage i.e., npm update slugify.


My package.json file is not got updated after that, although when i run npm outdated again it shows no outdated package. It means it got updated but my package.json file still shows the older version of the package.


Please let me know how can I update my package.json file also. I have tried npm update slugify --save also but it didn't worked for me.


More From » node.js

 Answers
0

The objective of the npm update command is to update your package-lock.json according to what you have specified in the package.json file.
This is the normal behavior.


If you want to update your package.json file, you can use npm-check-updates: npm install -g npm-check-updates.


You can then use these commands:



  1. ncu Checks for updates from the package.json file

  2. ncu -u Update the package.json file

  3. npm update --save Update your package-lock.json file from the package.json file


[#223] Saturday, March 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
katelynn

Total Points: 378
Total Questions: 86
Total Answers: 108

Location: Azerbaijan
Member since Fri, May 12, 2023
1 Year ago
katelynn questions
Fri, Mar 12, 21, 00:00, 3 Years ago
Mon, Nov 16, 20, 00:00, 4 Years ago
Thu, Jul 23, 20, 00:00, 4 Years ago
Wed, Apr 15, 20, 00:00, 4 Years ago
Wed, May 29, 19, 00:00, 5 Years ago
;