foundation-cli icon indicating copy to clipboard operation
foundation-cli copied to clipboard

Update npm dependency to v3+ for flat install

Open segphault opened this issue 8 years ago • 0 comments

Right now, using this cli tool to create a project with the Zurb foundation template pulls in about 700MB of dependencies. But when you clone the template from GitHub and run npm install inside of the directory, it only pulls in about 170MB.

This is happening because the cli uses npm v2 to programmatically perform the installation. Version 3 of npm introduced the new "flat" style of module installation, which supports dependency de-duplication. By using npm v2 to programmatically install the dependency, you are sacrificing de-duplication and dramatically increasing both the install size on disk and the amount of time that it takes to perform the install.

The fix is extremely easy: just change "npm": "^2.1.12" line in your package.json so that it uses a newer version.

segphault avatar Apr 27 '17 15:04 segphault