如何通过“npm安装”安装必要的软件包`

如何通过“npm安装”安装必要的软件包`,npm,Npm,我在package.json中有以下内容 { "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "laravel-elixir": "^4.0.0", "bootstrap-sass": "^3.0.0" } } 在运行npm install之后,当我检查node_模块时,安装了很多软件包。从.bin,abbrev到酵母。我想有200多个包裹。我认为

我在package.json中有以下内容

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.8"
  },
  "dependencies": {
    "laravel-elixir": "^4.0.0",
    "bootstrap-sass": "^3.0.0"
  }
}
在运行
npm install
之后,当我检查node_模块时,安装了很多软件包。从.bin,abbrev到酵母。我想有200多个包裹。我认为npm只安装必要的包,包括依赖项

问题1:如何避免安装不必要的软件包和只安装必要的软件包。我能做吗?还是我需要所有的包裹


问题2:npm是否安装了所有npm软件包?

摘要:

问题1:如何避免安装不必要的软件包和 只有必要的软件包。我能做吗?还是我需要所有的包裹

您正在安装模块依赖项(需要模块的模块)所需的所有依赖项

问题2:npm是否安装了所有npm软件包

没有

深度:

你装了一大口。以下是gulp的依赖项:

"dependencies": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  }
"dependencies": {
    "ansi-styles": "^2.1.0",
    "escape-string-regexp": "^1.0.2",
    "supports-color": "^3.1.2"
  },
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "end-of-stream": "~0.1.5",
    "sequencify": "~0.0.7",
    "stream-consume": "~0.1.0"
  },
"dependencies": {
    "babelify": "^7.2.0",
    "browser-sync": "^2.7.10",
    "browserify": "^11.2.0",
    "del": "^1.2.0",
    "glob": "^5.0.14",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-babel": "^6.1.0",
    "babel-preset-es2015": "^6.1.0",
    "babel-preset-react": "^6.1.18",
    "gulp-batch": "^1.0.5",
    "gulp-coffee": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.0.0",
    "gulp-if": "^1.2.5",
    "gulp-less": "^3.0.3",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-phpspec": "^0.5.3",
    "gulp-phpunit": "0.11.x",
    "gulp-rename": "^1.2.2",
    "gulp-rev": "^5.1.0",
    "gulp-rev-replace": "^0.4.2",
    "gulp-sass": "^2.0.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-shell": "^0.5.0",
    "gulp-uglify": "^1.4.2",
    "gulp-util": "^3.0.6",
    "gulp-watch": "^4.2.4",
    "insert-css": "^0.2.0",
    "merge-stream": "^0.1.8",
    "parse-filepath": "^0.5.0",
    "partialify": "^3.1.3",
    "path": "^0.11.14",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.1.1",
    "underscore": "^1.8.3",
    "underscore-deep-extend": "0.0.5",
    "vinyl-buffer": "^1.0.0",
    "vinyl-paths": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.2.3"
  },
archy具有以下依赖项:

"dependencies": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  }
"dependencies": {
    "ansi-styles": "^2.1.0",
    "escape-string-regexp": "^1.0.2",
    "supports-color": "^3.1.2"
  },
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "end-of-stream": "~0.1.5",
    "sequencify": "~0.0.7",
    "stream-consume": "~0.1.0"
  },
"dependencies": {
    "babelify": "^7.2.0",
    "browser-sync": "^2.7.10",
    "browserify": "^11.2.0",
    "del": "^1.2.0",
    "glob": "^5.0.14",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-babel": "^6.1.0",
    "babel-preset-es2015": "^6.1.0",
    "babel-preset-react": "^6.1.18",
    "gulp-batch": "^1.0.5",
    "gulp-coffee": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.0.0",
    "gulp-if": "^1.2.5",
    "gulp-less": "^3.0.3",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-phpspec": "^0.5.3",
    "gulp-phpunit": "0.11.x",
    "gulp-rename": "^1.2.2",
    "gulp-rev": "^5.1.0",
    "gulp-rev-replace": "^0.4.2",
    "gulp-sass": "^2.0.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-shell": "^0.5.0",
    "gulp-uglify": "^1.4.2",
    "gulp-util": "^3.0.6",
    "gulp-watch": "^4.2.4",
    "insert-css": "^0.2.0",
    "merge-stream": "^0.1.8",
    "parse-filepath": "^0.5.0",
    "partialify": "^3.1.3",
    "path": "^0.11.14",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.1.1",
    "underscore": "^1.8.3",
    "underscore-deep-extend": "0.0.5",
    "vinyl-buffer": "^1.0.0",
    "vinyl-paths": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.2.3"
  },
explorate(仍在执行gulp依赖项)具有以下依赖项:

"dependencies": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  }
"dependencies": {
    "ansi-styles": "^2.1.0",
    "escape-string-regexp": "^1.0.2",
    "supports-color": "^3.1.2"
  },
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "end-of-stream": "~0.1.5",
    "sequencify": "~0.0.7",
    "stream-consume": "~0.1.0"
  },
"dependencies": {
    "babelify": "^7.2.0",
    "browser-sync": "^2.7.10",
    "browserify": "^11.2.0",
    "del": "^1.2.0",
    "glob": "^5.0.14",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-babel": "^6.1.0",
    "babel-preset-es2015": "^6.1.0",
    "babel-preset-react": "^6.1.18",
    "gulp-batch": "^1.0.5",
    "gulp-coffee": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.0.0",
    "gulp-if": "^1.2.5",
    "gulp-less": "^3.0.3",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-phpspec": "^0.5.3",
    "gulp-phpunit": "0.11.x",
    "gulp-rename": "^1.2.2",
    "gulp-rev": "^5.1.0",
    "gulp-rev-replace": "^0.4.2",
    "gulp-sass": "^2.0.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-shell": "^0.5.0",
    "gulp-uglify": "^1.4.2",
    "gulp-util": "^3.0.6",
    "gulp-watch": "^4.2.4",
    "insert-css": "^0.2.0",
    "merge-stream": "^0.1.8",
    "parse-filepath": "^0.5.0",
    "partialify": "^3.1.3",
    "path": "^0.11.14",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.1.1",
    "underscore": "^1.8.3",
    "underscore-deep-extend": "0.0.5",
    "vinyl-buffer": "^1.0.0",
    "vinyl-paths": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.2.3"
  },
liftoff具有以下依赖项:

"dependencies": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  }
"dependencies": {
    "ansi-styles": "^2.1.0",
    "escape-string-regexp": "^1.0.2",
    "supports-color": "^3.1.2"
  },
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "end-of-stream": "~0.1.5",
    "sequencify": "~0.0.7",
    "stream-consume": "~0.1.0"
  },
"dependencies": {
    "babelify": "^7.2.0",
    "browser-sync": "^2.7.10",
    "browserify": "^11.2.0",
    "del": "^1.2.0",
    "glob": "^5.0.14",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-babel": "^6.1.0",
    "babel-preset-es2015": "^6.1.0",
    "babel-preset-react": "^6.1.18",
    "gulp-batch": "^1.0.5",
    "gulp-coffee": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.0.0",
    "gulp-if": "^1.2.5",
    "gulp-less": "^3.0.3",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-phpspec": "^0.5.3",
    "gulp-phpunit": "0.11.x",
    "gulp-rename": "^1.2.2",
    "gulp-rev": "^5.1.0",
    "gulp-rev-replace": "^0.4.2",
    "gulp-sass": "^2.0.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-shell": "^0.5.0",
    "gulp-uglify": "^1.4.2",
    "gulp-util": "^3.0.6",
    "gulp-watch": "^4.2.4",
    "insert-css": "^0.2.0",
    "merge-stream": "^0.1.8",
    "parse-filepath": "^0.5.0",
    "partialify": "^3.1.3",
    "path": "^0.11.14",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.1.1",
    "underscore": "^1.8.3",
    "underscore-deep-extend": "0.0.5",
    "vinyl-buffer": "^1.0.0",
    "vinyl-paths": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.2.3"
  },
orchestrator需要以下依赖项:

"dependencies": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  }
"dependencies": {
    "ansi-styles": "^2.1.0",
    "escape-string-regexp": "^1.0.2",
    "supports-color": "^3.1.2"
  },
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "end-of-stream": "~0.1.5",
    "sequencify": "~0.0.7",
    "stream-consume": "~0.1.0"
  },
"dependencies": {
    "babelify": "^7.2.0",
    "browser-sync": "^2.7.10",
    "browserify": "^11.2.0",
    "del": "^1.2.0",
    "glob": "^5.0.14",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-babel": "^6.1.0",
    "babel-preset-es2015": "^6.1.0",
    "babel-preset-react": "^6.1.18",
    "gulp-batch": "^1.0.5",
    "gulp-coffee": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.0.0",
    "gulp-if": "^1.2.5",
    "gulp-less": "^3.0.3",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-phpspec": "^0.5.3",
    "gulp-phpunit": "0.11.x",
    "gulp-rename": "^1.2.2",
    "gulp-rev": "^5.1.0",
    "gulp-rev-replace": "^0.4.2",
    "gulp-sass": "^2.0.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-shell": "^0.5.0",
    "gulp-uglify": "^1.4.2",
    "gulp-util": "^3.0.6",
    "gulp-watch": "^4.2.4",
    "insert-css": "^0.2.0",
    "merge-stream": "^0.1.8",
    "parse-filepath": "^0.5.0",
    "partialify": "^3.1.3",
    "path": "^0.11.14",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.1.1",
    "underscore": "^1.8.3",
    "underscore-deep-extend": "0.0.5",
    "vinyl-buffer": "^1.0.0",
    "vinyl-paths": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.2.3"
  },

简言之。。。安装的模块越大,依赖性越强,需要的依赖性就越多。这并不总是坏事。我建议只安装完成工作所需的设备(有时很多,有时没有)

更新

我刚注意到gulp是开发人员的依赖项。。。继续讨论elixir非开发依赖项:

"dependencies": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  }
"dependencies": {
    "ansi-styles": "^2.1.0",
    "escape-string-regexp": "^1.0.2",
    "supports-color": "^3.1.2"
  },
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "extend": "^2.0.1",
    "findup-sync": "^0.3.0",
    "flagged-respawn": "^0.3.1",
    "rechoir": "^0.6.0",
    "resolve": "^1.1.6"
  }
"dependencies": {
    "end-of-stream": "~0.1.5",
    "sequencify": "~0.0.7",
    "stream-consume": "~0.1.0"
  },
"dependencies": {
    "babelify": "^7.2.0",
    "browser-sync": "^2.7.10",
    "browserify": "^11.2.0",
    "del": "^1.2.0",
    "glob": "^5.0.14",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-babel": "^6.1.0",
    "babel-preset-es2015": "^6.1.0",
    "babel-preset-react": "^6.1.18",
    "gulp-batch": "^1.0.5",
    "gulp-coffee": "^2.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-cssnano": "^2.0.0",
    "gulp-if": "^1.2.5",
    "gulp-less": "^3.0.3",
    "gulp-load-plugins": "^1.0.0-rc.1",
    "gulp-notify": "^2.2.0",
    "gulp-phpspec": "^0.5.3",
    "gulp-phpunit": "0.11.x",
    "gulp-rename": "^1.2.2",
    "gulp-rev": "^5.1.0",
    "gulp-rev-replace": "^0.4.2",
    "gulp-sass": "^2.0.3",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-shell": "^0.5.0",
    "gulp-uglify": "^1.4.2",
    "gulp-util": "^3.0.6",
    "gulp-watch": "^4.2.4",
    "insert-css": "^0.2.0",
    "merge-stream": "^0.1.8",
    "parse-filepath": "^0.5.0",
    "partialify": "^3.1.3",
    "path": "^0.11.14",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.1.1",
    "underscore": "^1.8.3",
    "underscore-deep-extend": "0.0.5",
    "vinyl-buffer": "^1.0.0",
    "vinyl-paths": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.2.3"
  },