My package.json
:
我的package.json:
{
"name": "thumbnaillist-gulp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"browserify": "^12.0.1",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-react": "^3.1.0",
"gulp-util": "^3.0.7",
"react": "^0.13.3",
"react-script-loader": "0.0.1",
"reactify": "^1.1.1",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.6.1"
}
}
The weird thing is that after I execute "npm install", besides the modules listed in the dependencies field, other modules are also installed, such as
奇怪的是,在执行“npm安装”之后,除了依赖项字段中列出的模块之外,还安装了其他模块,例如
drwxr-xr-x 14 xxx wheel 476B Nov 18 18:41 acorn
drwxr-xr-x 7 xxx wheel 238B Nov 18 18:41 amdefine
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 ansi-green
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 ansi-regex
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 ansi-styles
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 ansi-wrap
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 anymatch
drwxr-xr-x 9 xxx wheel 306B Nov 18 18:41 archy
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 arr-diff
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 arr-flatten
drwxr-xr-x 5 xxx wheel 170B Nov 18 18:41 array-differ
drwxr-xr-x 8 xxx wheel 272B Nov 18 18:41 array-filter
drwxr-xr-x 9 xxx wheel 306B Nov 18 18:41 array-map
drwxr-xr-x 9 xxx wheel 306B Nov 18 18:41 array-reduce
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 array-slice
drwxr-xr-x 5 xxx wheel 170B Nov 18 18:41 array-uniq
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 array-unique
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 arrify
drwxr-xr-x 8 xxx wheel 272B Nov 18 18:41 asn1.js
drwxr-xr-x 10 xxx wheel 340B Nov 18 18:41 assert
drwxr-xr-x 10 xxx wheel 340B Nov 18 18:41 ast-types
drwxr-xr-x 9 xxx wheel 306B Nov 18 18:41 astw
drwxr-xr-x 9 xxx wheel 306B Nov 18 18:41 async-each
drwxr-xr-x 11 xxx wheel 374B Nov 18 18:41 balanced-match
drwxr-xr-x 8 xxx wheel 272B Nov 18 18:41 base62
drwxr-xr-x 9 xxx wheel 306B Nov 18 18:41 base64-js
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 beeper
drwxr-xr-x 6 xxx wheel 204B Nov 18 18:41 binary-extensions
drwxr-xr-x 10 xxx wheel 340B Nov 18 18:41 bn.js
drwxr-xr-x 7 xxx wheel 238B Nov 18 18:41 brace-expansion
drwxr-xr-x 7 xxx wheel 238B Nov 18 18:41 braces
drwxr-xr-x 7 xxx wheel 238B Nov 18 18:41 brorand
drwxr-xr-x 13 xxx wheel 442B Nov 18 18:41 browser-pack
drwxr-xr-x 7 xxx wheel 238B Nov 18 18:41 browser-resolve
drwxr-xr-x 12 xxx wheel 408B Nov 18 18:41 browserify
drwxr-xr-x 17 xxx wheel 578B Nov 18 18:41 browserify-aes
drwxr-xr-x 8 xxx wheel 272B Nov 18 18:41 browserify-cipher
drwxr-xr-x 7 xxx wheel 238B Nov 18 18:41 browserify-des
drwxr-xr-x 8 xxx wheel 272B Nov 18 18:41 browserify-rsa
drwxr-xr-x 16 xxx wheel 544B Nov 18 18:41 browserify-sign
drwxr-xr-x 8 xxx wheel 272B Nov 18 18:41 browserify-zlib
drwxr-xr-x 11 xxx wheel 374B Nov 18 18:41 buffer
drwxr-xr-x 11 xxx wheel 374B Nov 18 18:41 buffer-xor
Any hint on this? Is my NPM broken? Or I did not write a package.json
in a correct way.
任何提示吗?是我NPM坏了?或者我没有写一个包裹。json是正确的。
2 个解决方案
#1
16
No there's nothing wrong, NPM now installs all dependencies to the root modules folder unless there is a version conflict. All those other modules you are seeing are dependencies of the modules you installed.
没有问题,NPM现在将所有依赖项安装到根模块文件夹,除非存在版本冲突。您看到的所有其他模块都是您安装的模块的依赖关系。
From the NPM 3.0.0 release notes:
从NPM 3.0.0发行说明:
Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting. You'll only see modules nested underneath one another when two (or more) modules have conflicting dependencies.
您的依赖项现在将被安装到最大平面上。在尽可能的情况下,您的所有依赖项、它们的依赖项和它们的依赖项都将安装在项目的node_modules文件夹中,没有嵌套。只有当两个(或多个)模块具有相互冲突的依赖关系时,才会看到模块相互嵌套。
#2
1
I hope Alexander O'Mara answer is helpful for you If you still want or for those who want to use dependencies like older version
我希望Alexander O'Mara的回答对您有帮助,如果您仍然需要,或者对于那些想要使用依赖关系的人,比如旧版本
you can use
您可以使用
npm install --legacy-bundling
npm安装——legacy-bundling
If you always want use
如果你一直想用。
npm set legacy-bundling=true
npm legacy-bundling = true
and use can run as usual
使用也可以正常运行
npm install
npm安装
#1
16
No there's nothing wrong, NPM now installs all dependencies to the root modules folder unless there is a version conflict. All those other modules you are seeing are dependencies of the modules you installed.
没有问题,NPM现在将所有依赖项安装到根模块文件夹,除非存在版本冲突。您看到的所有其他模块都是您安装的模块的依赖关系。
From the NPM 3.0.0 release notes:
从NPM 3.0.0发行说明:
Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting. You'll only see modules nested underneath one another when two (or more) modules have conflicting dependencies.
您的依赖项现在将被安装到最大平面上。在尽可能的情况下,您的所有依赖项、它们的依赖项和它们的依赖项都将安装在项目的node_modules文件夹中,没有嵌套。只有当两个(或多个)模块具有相互冲突的依赖关系时,才会看到模块相互嵌套。
#2
1
I hope Alexander O'Mara answer is helpful for you If you still want or for those who want to use dependencies like older version
我希望Alexander O'Mara的回答对您有帮助,如果您仍然需要,或者对于那些想要使用依赖关系的人,比如旧版本
you can use
您可以使用
npm install --legacy-bundling
npm安装——legacy-bundling
If you always want use
如果你一直想用。
npm set legacy-bundling=true
npm legacy-bundling = true
and use can run as usual
使用也可以正常运行
npm install
npm安装