Section 2.7: Removing extraneous packages To remove extraneous packages (packages that are installed but not in dependency list) run the following command: npm prune To remove all dev packages add --production flag: npm prune --production