Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMartina Carrington
15,754 PointsChallenge Task 1 of 1 Update the global package npm.
i try npm install update -g and npm install - g i keep getting error
3 Answers
William Li
Courses Plus Student 26,868 PointsHi, Martina, the correct command is
npm update -g npm
Update the global package npm.
It may come as surprise, but npm itself is a global package, and you can use npm to update npm.
Keith Gulbro
16,078 PointsYou can also do a global update using a similar but different format:
npm update <package> -g
tinomudaishemurombedzi
5,784 Pointsim still getting an error massage even if i copy and paste this code
Martina Carrington
15,754 Pointsoh ok ! now i got it , Thanks so William Li
William Li
Courses Plus Student 26,868 PointsCool :) happy coding.
Martina Carrington
15,754 PointsMartina Carrington
15,754 Pointswait so it's not npm install update - g ? how come we have to add a extra npm at end ? Thanks @William Li
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 PointsAs I've previously said, npm itself is a global package, and the syntax for updating global package is.
As to why we need to update npm? Because that's what the code challenge is asking for
Update the global package npm.