# Update global top level npm packages ## Problem `npm update -g` updates all global packages *and their dependencies*, see https://github.com/npm/npm/issues/6247. ## Solution 1. Either use the shell script or windows batch here instead. The shell script is forked from https://gist.github.com/othiym23/4ac31155da23962afd0e. See the discussion there. 2. Or use https://github.com/dylang/npm-check to interactively select which global/local packages to update ``` # install npm -g i npm-check # interactive update of global packages npm-check -u -g # interactive update for a project you are working on npm-check -u ``` ![Sample using npm-check -u](https://camo.githubusercontent.com/fd837de4101195dd7813b9905bcc58dd849008d8/68747470733a2f2f636c6f75642e67697468756275736572636f6e74656e742e636f6d2f6173736574732f35313530352f343730333133352f34316531373366652d353836382d313165342d393030352d3037363737333239613131362e706e67 "Sample using npm-check -u")