npm install --save-dev gulp-install

时间:2016-04-25 14:14:31

标签: node.js npm gulp npm-install

我是Node和Gulp的新手。之前我曾经和它合作过,并希望建立一个新项目,但我遇到了一些麻烦。

我正在尝试在项目根目录中安装gulp。但是在运行npm install --save-dev gulp-install以及带有136的node_modules文件夹后,在我的命令提示符下获取此信息!里面的文件夹/模块。

E:\XAMPP\htdocs\test>npm install --save-dev gulp
npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN saveError ENOENT: no such file or directory, open 'E:\XAMPP\htdocs\test\package.json'
E:\XAMPP\htdocs\test
`-- gulp@3.9.1
  +-- archy@1.0.0
  +-- chalk@1.1.3
  | +-- ansi-styles@2.2.1
  | +-- escape-string-regexp@1.0.5
  | +-- has-ansi@2.0.0
  | | `-- ansi-regex@2.0.0
  | +-- strip-ansi@3.0.1
  | `-- supports-color@2.0.0
  +-- deprecated@0.0.1
  +-- gulp-util@3.0.7
  | +-- array-differ@1.0.0
  | +-- array-uniq@1.0.2
  | +-- beeper@1.1.0
  | +-- dateformat@1.0.12
  | | +-- get-stdin@4.0.1
  | | `-- meow@3.7.0
  | |   +-- camelcase-keys@2.1.0
  | |   | `-- camelcase@2.1.1
  | |   +-- decamelize@1.2.0
  | |   +-- loud-rejection@1.3.0
  | |   | +-- array-find-index@1.0.1
  | |   | `-- signal-exit@2.1.2
  | |   +-- map-obj@1.0.1
  | |   +-- normalize-package-data@2.3.5
  | |   | +-- hosted-git-info@2.1.4
  | |   | +-- is-builtin-module@1.0.0
  | |   | | `-- builtin-modules@1.1.1
  | |   | `-- validate-npm-package-license@3.0.1
  | |   |   +-- spdx-correct@1.0.2
  | |   |   | `-- spdx-license-ids@1.2.1
  | |   |   `-- spdx-expression-parse@1.0.2
  | |   |     `-- spdx-exceptions@1.0.4
  | |   +-- object-assign@4.0.1
  | |   +-- read-pkg-up@1.0.1
  | |   | +-- find-up@1.1.2
  | |   | | +-- path-exists@2.1.0
  | |   | | `-- pinkie-promise@2.0.1
  | |   | |   `-- pinkie@2.0.4
  | |   | `-- read-pkg@1.1.0
  | |   |   +-- load-json-file@1.1.0
  | |   |   | +-- graceful-fs@4.1.3
  | |   |   | +-- parse-json@2.2.0
  | |   |   | | `-- error-ex@1.3.0
  | |   |   | |   `-- is-arrayish@0.2.1
  | |   |   | +-- pify@2.3.0
  | |   |   | `-- strip-bom@2.0.0
  | |   |   `-- path-type@1.1.0
  | |   +-- redent@1.0.0
  | |   | +-- indent-string@2.1.0
  | |   | | `-- repeating@2.0.1
  | |   | |   `-- is-finite@1.0.1
  | |   | |     `-- number-is-nan@1.0.0
  | |   | `-- strip-indent@1.0.1
  | |   `-- trim-newlines@1.0.0
  | +-- fancy-log@1.2.0
  | | `-- time-stamp@1.0.1
  | +-- gulplog@1.0.0
  | | `-- glogg@1.0.0
  | +-- has-gulplog@0.1.0
  | | `-- sparkles@1.0.0
  | +-- lodash._reescape@3.0.0
  | +-- lodash._reevaluate@3.0.0
  | +-- lodash._reinterpolate@3.0.0
  | +-- lodash.template@3.6.2
  | | +-- lodash._basecopy@3.0.1
  | | +-- lodash._basetostring@3.0.1
  | | +-- lodash._basevalues@3.0.0
  | | +-- lodash._isiterateecall@3.0.9
  | | +-- lodash.escape@3.2.0
  | | | `-- lodash._root@3.0.1
  | | +-- lodash.keys@3.1.2
  | | | +-- lodash._getnative@3.9.1
  | | | +-- lodash.isarguments@3.0.8
  | | | `-- lodash.isarray@3.0.4
  | | +-- lodash.restparam@3.6.1
  | | `-- lodash.templatesettings@3.1.1
  | +-- multipipe@0.1.2
  | | `-- duplexer2@0.0.2
  | |   `-- readable-stream@1.1.14
  | +-- object-assign@3.0.0
  | +-- replace-ext@0.0.1
  | +-- through2@2.0.1
  | | +-- readable-stream@2.0.6
  | | | +-- core-util-is@1.0.2
  | | | +-- inherits@2.0.1
  | | | +-- isarray@1.0.0
  | | | +-- process-nextick-args@1.0.6
  | | | +-- string_decoder@0.10.31
  | | | `-- util-deprecate@1.0.2
  | | `-- xtend@4.0.1
  | `-- vinyl@0.5.3
  |   +-- clone@1.0.2
  |   `-- clone-stats@0.0.1
  +-- interpret@1.0.0
  +-- liftoff@2.2.1
  | +-- extend@2.0.1
  | +-- findup-sync@0.3.0
  | | `-- glob@5.0.15
  | |   +-- inflight@1.0.4
  | |   +-- minimatch@3.0.0
  | |   `-- path-is-absolute@1.0.0
  | +-- flagged-respawn@0.3.2
  | +-- rechoir@0.6.2
  | `-- resolve@1.1.7
  +-- minimist@1.2.0
  +-- orchestrator@0.3.7
  | +-- end-of-stream@0.1.5
  | | `-- once@1.3.3
  | |   `-- wrappy@1.0.1
  | +-- sequencify@0.0.7
  | `-- stream-consume@0.1.0
  +-- pretty-hrtime@1.0.2
  +-- semver@4.3.6
  +-- tildify@1.2.0
  | `-- os-homedir@1.0.1
  +-- v8flags@2.0.11
  | `-- user-home@1.1.1
  `-- vinyl-fs@0.3.14
    +-- defaults@1.0.3
    +-- glob-stream@3.1.18
    | +-- glob@4.5.3
    | +-- glob2base@0.0.12
    | | `-- find-index@0.1.1
    | +-- minimatch@2.0.10
    | | `-- brace-expansion@1.1.3
    | |   +-- balanced-match@0.3.0
    | |   `-- concat-map@0.0.1
    | +-- ordered-read-streams@0.1.0
    | +-- through2@0.6.5
    | | `-- readable-stream@1.0.34
    | `-- unique-stream@1.0.0
    +-- glob-watcher@0.0.6
    | `-- gaze@0.5.2
    |   `-- globule@0.1.0
    |     +-- glob@3.1.21
    |     | +-- graceful-fs@1.2.3
    |     | `-- inherits@1.0.2
    |     +-- lodash@1.0.2
    |     `-- minimatch@0.2.14
    |       +-- lru-cache@2.7.3
    |       `-- sigmund@1.0.1
    +-- graceful-fs@3.0.8
    +-- mkdirp@0.5.1
    | `-- minimist@0.0.8
    +-- strip-bom@1.0.0
    | +-- first-chunk-stream@1.0.0
    | `-- is-utf8@0.2.1
    +-- through2@0.6.5
    | `-- readable-stream@1.0.34
    |   `-- isarray@0.0.1
    `-- vinyl@0.4.6
      `-- clone@0.2.0

npm WARN enoent ENOENT: no such file or directory, open 'E:\XAMPP\htdocs\test\package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

我将Node.js重新安装到v4.4.3,并在执行命令之前完全安装了gulp。我尝试按照tutorial进行操作。

我的项目文件夹位于驱动器E上,节点也安装在此驱动器上。 (我的启动驱动器和程序文件位于驱动器C上)。我有Windows 10。

希望有人可以帮忙!我期待与gulp一起工作,但似乎没有任何工作。

1 个答案:

答案 0 :(得分:5)

当您执行--save-dev npm时,将查找您的package.json并将您的包添加到devDependencies。

您可能尚未生成一个。你可以通过

这样做
npm init 

并按照提示进行操作,或

npm init -Y 

接受所有默认值。