NPM 包目录混乱
NPM Package Directory Mess
以前,当我在我的项目下 运行 npm install
时,它通过安装我在 packages.json
文件下定义的所有包,正确且很好地安装了所有节点模块。
现在我已经将 npm
和 node
更新到最新版本,当我 运行 npm install
90% 的 npm 包子目录将安装在 node_modules
文件夹。这样看起来会很乱。这是文件夹的图片:(由于分辨率有限,我无法获取所有文件夹)
这是我的 package.json
文件:
{
"name": "my-application",
"description": "description here...",
"repository": {
"type": "git",
"url": ""
},
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-bower-install": "~0.7.0",
"grunt-concurrent": "~0.4.1",
"grunt-connect-proxy": "~0.2.0",
"grunt-connect-socket.io": "^0.7.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~1.0.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.11.2",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-imagemin": "~0.3.0",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-fixmyjs": "0.2.0",
"grunt-google-cdn": "~0.2.0",
"grunt-karma": "~0.6.2",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-rev": "~0.1.0",
"grunt-usemin": "~2.0.0",
"jasmine": "~2.3.1",
"jshint-stylish": "~0.1.3",
"jshint-stylish-ex": "^0.2.0",
"karma": "~0.10.8",
"karma-chrome-launcher": "~0.1.1",
"karma-coffee-preprocessor": "~0.1.1",
"karma-firefox-launcher": "~0.1.2",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.5",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-ng-scenario": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.1",
"karma-requirejs": "~0.2.0",
"karma-script-launcher": "~0.1.0",
"load-grunt-tasks": "~0.2.0",
"requirejs": "~2.1.9",
"socket.io": "~1.3.7",
"socket.io-client": "^1.3.7",
"time-grunt": "~0.2.1"
},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}
我如何正确区分 npm
到 install/arrange 目录?
NPM 版本:3.5.0
节点版本:5.1.0
我使用 g运行t 来 运行 项目。
在 npm 3
中,您的依赖项现在将被默认安装。如果可能的话,你所有的依赖,以及它们的依赖,它们的依赖都将安装在你项目的 node_modules 文件夹中,而不会嵌套。只有当两个或多个模块具有冲突的依赖关系时才会发生嵌套。
这样做是因为 windows 中对最大路径长度有限制。
以前,当我在我的项目下 运行 npm install
时,它通过安装我在 packages.json
文件下定义的所有包,正确且很好地安装了所有节点模块。
现在我已经将 npm
和 node
更新到最新版本,当我 运行 npm install
90% 的 npm 包子目录将安装在 node_modules
文件夹。这样看起来会很乱。这是文件夹的图片:(由于分辨率有限,我无法获取所有文件夹)
这是我的 package.json
文件:
{
"name": "my-application",
"description": "description here...",
"repository": {
"type": "git",
"url": ""
},
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-bower-install": "~0.7.0",
"grunt-concurrent": "~0.4.1",
"grunt-connect-proxy": "~0.2.0",
"grunt-connect-socket.io": "^0.7.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~1.0.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.11.2",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-imagemin": "~0.3.0",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-fixmyjs": "0.2.0",
"grunt-google-cdn": "~0.2.0",
"grunt-karma": "~0.6.2",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-rev": "~0.1.0",
"grunt-usemin": "~2.0.0",
"jasmine": "~2.3.1",
"jshint-stylish": "~0.1.3",
"jshint-stylish-ex": "^0.2.0",
"karma": "~0.10.8",
"karma-chrome-launcher": "~0.1.1",
"karma-coffee-preprocessor": "~0.1.1",
"karma-firefox-launcher": "~0.1.2",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.5",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-ng-scenario": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.1",
"karma-requirejs": "~0.2.0",
"karma-script-launcher": "~0.1.0",
"load-grunt-tasks": "~0.2.0",
"requirejs": "~2.1.9",
"socket.io": "~1.3.7",
"socket.io-client": "^1.3.7",
"time-grunt": "~0.2.1"
},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}
我如何正确区分 npm
到 install/arrange 目录?
NPM 版本:3.5.0 节点版本:5.1.0
我使用 g运行t 来 运行 项目。
在 npm 3
中,您的依赖项现在将被默认安装。如果可能的话,你所有的依赖,以及它们的依赖,它们的依赖都将安装在你项目的 node_modules 文件夹中,而不会嵌套。只有当两个或多个模块具有冲突的依赖关系时才会发生嵌套。
这样做是因为 windows 中对最大路径长度有限制。