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 trial

JavaScript

uninstall npm packages globally

Hi, I am unable to uninstall node, sass, npm which i install globally. Also need help in figuring out which package can be global and which are project specific.

Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ npm -v
5.5.1
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ node -v
v8.9.1
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ sass -v
Sass 3.5.3 (Bleeding Edge)
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ npm uninstall sass
npm WARN saveError ENOENT: no such file or directory, open '/package.json'
npm WARN saveError EACCES: permission denied, open '/package-lock.json.1286701303'
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#2 No description
npm WARN !invalid#2 No repository field.
npm WARN !invalid#2 No README data
npm WARN !invalid#2 No license field.

up to date in 0.046s
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ npm uninstall sass -g
up to date in 0.043s
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ npm uninstall node
npm WARN saveError ENOENT: no such file or directory, open '/package.json'
npm WARN saveError EACCES: permission denied, open '/package-lock.json.567584276'
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#2 No description
npm WARN !invalid#2 No repository field.
npm WARN !invalid#2 No README data
npm WARN !invalid#2 No license field.

up to date in 0.046s
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ npm uninstall node -g
up to date in 0.045s
Jayaramans-MacBook-Pro:/ jayaramanthiyyadi$ 

Note: planning on developing a simple dynamic site for learning purpose using html, css, sass, bootstrap, javascript, jquery for front end development and for backend I hope nodejs and mongo db.

1 Answer

Jordan Watson
Jordan Watson
14,738 Points

To uninstall NPM packages globally you need to ensure you have the global flag in in remove line i.e

npm uninstall -g <package>