Menu icon Foundation
Node Modules

Hi,

It´s fine that when I run npm install I get installed 571 modules in node_modules instead of 18 devDependencies located in package.json file included in Zurb Foundation Template?

I attach images from Terminal and Finder with show installation process and results.

Install all

Node modules

{
  "name": "foundation-zurb-template",
  "version": "1.0.0",
  "description": "Official ZURB Template for Foundation for Sites.",
  "main": "gulpfile.js",
  "scripts": {
    "start": "gulp",
    "build": "gulp build --production"
  },
  "author": "ZURB <[email protected]>",
  "license": "MIT",
  "devDependencies": {
    "browser-sync": "^2.10.0",
    "gulp": "^3.9.0",
    "gulp-autoprefixer": "^3.1.0",
    "gulp-concat": "^2.5.2",
    "gulp-extname": "^0.2.0",
    "gulp-if": "^2.0.0",
    "gulp-imagemin": "^2.2.1",
    "gulp-load-plugins": "^1.1.0",
    "gulp-minify-css": "^1.2.1",
    "gulp-sass": "^2.1.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify": "^1.2.0",
    "gulp-uncss": "^1.0.1",
    "panini": "^1.0.0",
    "rimraf": "^2.4.3",
    "run-sequence": "^1.1.0",
    "style-sherpa": "^1.0.0",
    "yargs": "^3.8.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/zurb/foundation-zurb-template.git"
  },
  "bugs": {
    "url": "https://github.com/zurb/foundation-sites/issues",
    "email": "[email protected]"
  },
  "private": true
}

            

         

npm-installpackage.json

Hi,

It´s fine that when I run npm install I get installed 571 modules in node_modules instead of 18 devDependencies located in package.json file included in Zurb Foundation Template?

I attach images from Terminal and Finder with show installation process and results.

Install all

Node modules

{
  "name": "foundation-zurb-template",
  "version": "1.0.0",
  "description": "Official ZURB Template for Foundation for Sites.",
  "main": "gulpfile.js",
  "scripts": {
    "start": "gulp",
    "build": "gulp build --production"
  },
  "author": "ZURB <[email protected]>",
  "license": "MIT",
  "devDependencies": {
    "browser-sync": "^2.10.0",
    "gulp": "^3.9.0",
    "gulp-autoprefixer": "^3.1.0",
    "gulp-concat": "^2.5.2",
    "gulp-extname": "^0.2.0",
    "gulp-if": "^2.0.0",
    "gulp-imagemin": "^2.2.1",
    "gulp-load-plugins": "^1.1.0",
    "gulp-minify-css": "^1.2.1",
    "gulp-sass": "^2.1.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify": "^1.2.0",
    "gulp-uncss": "^1.0.1",
    "panini": "^1.0.0",
    "rimraf": "^2.4.3",
    "run-sequence": "^1.1.0",
    "style-sherpa": "^1.0.0",
    "yargs": "^3.8.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/zurb/foundation-zurb-template.git"
  },
  "bugs": {
    "url": "https://github.com/zurb/foundation-sites/issues",
    "email": "[email protected]"
  },
  "private": true
}

            

         
Geoff Kimball almost 4 years ago

From npm version 2 to 3, the way packages are installed changed.

It used to be, if you had 18 dependencies, you got 18 folders inside node_modules, and then each of those folders had folders for its dependencies, and so on and so forth.

With npm 3, only one instance of each dependency is installed, and they're all put in one big list. This makes file paths shorter (a problem for Windows users), and reduces the file size of the node_modules folder by cutting down on duplicate installs of packages.

Philip Cook almost 4 years ago

Geoff, thanks for this update.

I have installed npm v3.

Then removed foudation-cli and re-installed it.

When I create a new project with "foundation new" from a cmd prompt I still get the crazy nested folder structure under node_modules.

But if you then switch to your project folder and use "npm dedupe" the proper v3 folder structure is created and duplicate copies of the module dependencies removed.

So a new project now requires at CLI

foundation new
cd
npm dedupe
foundation watch