npm默认安装近200个库

时间:2016-11-22 03:46:50

标签: node.js npm

我对npm很新,所以这可能很简单,但我还没有发现它在任何地方都有提及。也许这只是一个配置错误。

我正慢慢进入npm和任务自动化,目前正在跟随this tutorial(CSS-Tricks)学习gulp的基础知识。

当我执行命令npm install gulp --save-dev时,我得到的结果与教程中的结果完全不同。安装gulp后,我项目的node_modules文件夹包含196个文件夹:

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       11/22/2016      4:40                .bin
d-----       11/22/2016      4:40                ansi-regex
d-----       11/22/2016      4:40                ansi-styles
d-----       11/22/2016      4:40                archy
d-----       11/22/2016      4:40                arr-diff
d-----       11/22/2016      4:40                arr-flatten
d-----       11/22/2016      4:40                array-differ
d-----       11/22/2016      4:40                array-find-index
d-----       11/22/2016      4:40                array-uniq
d-----       11/22/2016      4:40                array-unique
d-----       11/22/2016      4:40                balanced-match
d-----       11/22/2016      4:40                beeper
d-----       11/22/2016      4:40                brace-expansion
d-----       11/22/2016      4:40                braces
d-----       11/22/2016      4:40                builtin-modules
d-----       11/22/2016      4:40                camelcase
d-----       11/22/2016      4:40                camelcase-keys
d-----       11/22/2016      4:40                chalk
d-----       11/22/2016      4:40                clone
d-----       11/22/2016      4:40                clone-stats
d-----       11/22/2016      4:40                concat-map
d-----       11/22/2016      4:40                core-util-is
d-----       11/22/2016      4:40                currently-unhandled
d-----       11/22/2016      4:40                dateformat
d-----       11/22/2016      4:40                decamelize
d-----       11/22/2016      4:40                defaults
d-----       11/22/2016      4:40                deprecated
d-----       11/22/2016      4:40                detect-file
d-----       11/22/2016      4:40                duplexer2
d-----       11/22/2016      4:40                end-of-stream
d-----       11/22/2016      4:40                error-ex
d-----       11/22/2016      4:40                escape-string-regexp
d-----       11/22/2016      4:40                expand-brackets
d-----       11/22/2016      4:40                expand-range
d-----       11/22/2016      4:40                expand-tilde
d-----       11/22/2016      4:40                extend
d-----       11/22/2016      4:40                extglob
d-----       11/22/2016      4:40                fancy-log
d-----       11/22/2016      4:40                filename-regex
d-----       11/22/2016      4:40                fill-range
d-----       11/22/2016      4:40                find-index
d-----       11/22/2016      4:40                find-up
d-----       11/22/2016      4:40                findup-sync
d-----       11/22/2016      4:40                fined
d-----       11/22/2016      4:40                first-chunk-stream
d-----       11/22/2016      4:40                flagged-respawn
d-----       11/22/2016      4:40                for-in
d-----       11/22/2016      4:40                for-own
d-----       11/22/2016      4:40                fs-exists-sync
d-----       11/22/2016      4:40                gaze
d-----       11/22/2016      4:40                get-stdin
d-----       11/22/2016      4:40                glob
d-----       11/22/2016      4:40                glob-base
d-----       11/22/2016      4:40                glob-parent
d-----       11/22/2016      4:40                glob-stream
d-----       11/22/2016      4:40                glob-watcher
d-----       11/22/2016      4:40                glob2base
d-----       11/22/2016      4:40                global-modules
d-----       11/22/2016      4:40                global-prefix
d-----       11/22/2016      4:40                globule
d-----       11/22/2016      4:40                glogg
d-----       11/22/2016      4:40                graceful-fs
d-----       11/22/2016      4:40                gulp
d-----       11/22/2016      4:40                gulp-util
d-----       11/22/2016      4:40                gulplog
d-----       11/22/2016      4:40                has-ansi
d-----       11/22/2016      4:40                has-gulplog
d-----       11/22/2016      4:40                hosted-git-info
d-----       11/22/2016      4:40                indent-string
d-----       11/22/2016      4:40                inflight
d-----       11/22/2016      4:40                inherits
d-----       11/22/2016      4:40                ini
d-----       11/22/2016      4:40                interpret
d-----       11/22/2016      4:40                is-absolute
d-----       11/22/2016      4:40                is-arrayish
d-----       11/22/2016      4:40                is-buffer
d-----       11/22/2016      4:40                is-builtin-module
d-----       11/22/2016      4:40                is-dotfile
d-----       11/22/2016      4:40                is-equal-shallow
d-----       11/22/2016      4:40                is-extendable
d-----       11/22/2016      4:40                is-extglob
d-----       11/22/2016      4:40                is-finite
d-----       11/22/2016      4:40                is-glob
d-----       11/22/2016      4:40                is-number
d-----       11/22/2016      4:40                is-posix-bracket
d-----       11/22/2016      4:40                is-primitive
d-----       11/22/2016      4:40                is-relative
d-----       11/22/2016      4:40                is-unc-path
d-----       11/22/2016      4:40                is-utf8
d-----       11/22/2016      4:40                is-windows
d-----       11/22/2016      4:40                isarray
d-----       11/22/2016      4:40                isexe
d-----       11/22/2016      4:40                isobject
d-----       11/22/2016      4:40                kind-of
d-----       11/22/2016      4:40                liftoff
d-----       11/22/2016      4:40                load-json-file
d-----       11/22/2016      4:40                lodash
d-----       11/22/2016      4:40                lodash.assignwith
d-----       11/22/2016      4:40                lodash.escape
d-----       11/22/2016      4:40                lodash.isarguments
d-----       11/22/2016      4:40                lodash.isarray
d-----       11/22/2016      4:40                lodash.isempty
d-----       11/22/2016      4:40                lodash.isplainobject
d-----       11/22/2016      4:40                lodash.isstring
d-----       11/22/2016      4:40                lodash.keys
d-----       11/22/2016      4:40                lodash.mapvalues
d-----       11/22/2016      4:40                lodash.pick
d-----       11/22/2016      4:40                lodash.restparam
d-----       11/22/2016      4:40                lodash.template
d-----       11/22/2016      4:40                lodash.templatesettings
d-----       11/22/2016      4:40                lodash._basecopy
d-----       11/22/2016      4:40                lodash._basetostring
d-----       11/22/2016      4:40                lodash._basevalues
d-----       11/22/2016      4:40                lodash._getnative
d-----       11/22/2016      4:40                lodash._isiterateecall
d-----       11/22/2016      4:40                lodash._reescape
d-----       11/22/2016      4:40                lodash._reevaluate
d-----       11/22/2016      4:40                lodash._reinterpolate
d-----       11/22/2016      4:40                lodash._root
d-----       11/22/2016      4:40                loud-rejection
d-----       11/22/2016      4:40                lru-cache
d-----       11/22/2016      4:40                map-cache
d-----       11/22/2016      4:40                map-obj
d-----       11/22/2016      4:40                meow
d-----       11/22/2016      4:40                micromatch
d-----       11/22/2016      4:40                minimatch
d-----       11/22/2016      4:40                minimist
d-----       11/22/2016      4:40                mkdirp
d-----       11/22/2016      4:40                multipipe
d-----       11/22/2016      4:40                natives
d-----       11/22/2016      4:40                normalize-package-data
d-----       11/22/2016      4:40                normalize-path
d-----       11/22/2016      4:40                number-is-nan
d-----       11/22/2016      4:40                object-assign
d-----       11/22/2016      4:40                object.omit
d-----       11/22/2016      4:40                once
d-----       11/22/2016      4:40                orchestrator
d-----       11/22/2016      4:40                ordered-read-streams
d-----       11/22/2016      4:40                os-homedir
d-----       11/22/2016      4:40                os-tmpdir
d-----       11/22/2016      4:40                osenv
d-----       11/22/2016      4:40                parse-filepath
d-----       11/22/2016      4:40                parse-glob
d-----       11/22/2016      4:40                parse-json
d-----       11/22/2016      4:40                path-exists
d-----       11/22/2016      4:40                path-root
d-----       11/22/2016      4:40                path-root-regex
d-----       11/22/2016      4:40                path-type
d-----       11/22/2016      4:40                pify
d-----       11/22/2016      4:40                pinkie
d-----       11/22/2016      4:40                pinkie-promise
d-----       11/22/2016      4:40                preserve
d-----       11/22/2016      4:40                pretty-hrtime
d-----       11/22/2016      4:40                process-nextick-args
d-----       11/22/2016      4:40                randomatic
d-----       11/22/2016      4:40                read-pkg
d-----       11/22/2016      4:40                read-pkg-up
d-----       11/22/2016      4:40                readable-stream
d-----       11/22/2016      4:40                rechoir
d-----       11/22/2016      4:40                redent
d-----       11/22/2016      4:40                regex-cache
d-----       11/22/2016      4:40                repeat-element
d-----       11/22/2016      4:40                repeat-string
d-----       11/22/2016      4:40                repeating
d-----       11/22/2016      4:40                replace-ext
d-----       11/22/2016      4:40                resolve
d-----       11/22/2016      4:40                resolve-dir
d-----       11/22/2016      4:40                semver
d-----       11/22/2016      4:40                sequencify
d-----       11/22/2016      4:40                sigmund
d-----       11/22/2016      4:40                signal-exit
d-----       11/22/2016      4:40                sparkles
d-----       11/22/2016      4:40                spdx-correct
d-----       11/22/2016      4:40                spdx-expression-parse
d-----       11/22/2016      4:40                spdx-license-ids
d-----       11/22/2016      4:40                stream-consume
d-----       11/22/2016      4:40                string_decoder
d-----       11/22/2016      4:40                strip-ansi
d-----       11/22/2016      4:40                strip-bom
d-----       11/22/2016      4:40                strip-indent
d-----       11/22/2016      4:40                supports-color
d-----       11/22/2016      4:40                through2
d-----       11/22/2016      4:40                tildify
d-----       11/22/2016      4:40                time-stamp
d-----       11/22/2016      4:40                trim-newlines
d-----       11/22/2016      4:40                unc-path-regex
d-----       11/22/2016      4:40                unique-stream
d-----       11/22/2016      4:40                user-home
d-----       11/22/2016      4:40                util-deprecate
d-----       11/22/2016      4:40                v8flags
d-----       11/22/2016      4:40                validate-npm-package-license
d-----       11/22/2016      4:40                vinyl
d-----       11/22/2016      4:40                vinyl-fs
d-----       11/22/2016      4:40                which
d-----       11/22/2016      4:40                wrappy
d-----       11/22/2016      4:40                xtend

为了确保在重新安装Node.js之前我没有弄乱它,结果是一样的。我正在运行Windows 10。

这应该发生吗?如果没有,我该如何解决?

2 个答案:

答案 0 :(得分:0)

原来我的Google-Fu不像过去那样。我发现了一个关于on this very page的问题。

显然这是默认情况下较新版本的npm安装依赖项的方式,一切都很好,教程只是使用旧版本的npm。

答案 1 :(得分:0)

这很正常。 npm解析了gulp的整个依赖树,这可能很多。依赖项可以包含依赖项,然后包含其他依赖项。

此外,npm将所有内容安装为平面且无嵌套:https://github.com/npm/npm/issues/9809,这就是您的目录中有很多文件的原因。

相关问题