Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing peer dependency: ajv@>=5.0.3-beta.0 #1344

Closed
bcomnes opened this issue Mar 8, 2017 · 36 comments · May be fixed by qcif/data-curator#563
Closed

Missing peer dependency: ajv@>=5.0.3-beta.0 #1344

bcomnes opened this issue Mar 8, 2017 · 36 comments · May be fixed by qcif/data-curator#563

Comments

@bcomnes
Copy link
Contributor

bcomnes commented Mar 8, 2017

  • Version: 15.1.1
  • Target: OS X

A recent version of electron-builder (^15.1.1) started logging peer dependency warnings on install:

npm WARN ajv-keywords@2.0.1-beta.1 requires a peer of ajv@>=5.0.3-beta.0 but none was installed.
─┬ electron-builder@15.1.1 
│ ├─┬ 7zip-bin@2.0.4 
│ │ └── 7zip-bin-mac@1.0.1 
│ ├─┬ UNMET PEER DEPENDENCY ajv@5.0.3-beta.0
│ │ ├── co@4.6.0 
│ │ └── json-stable-stringify@1.0.1 
│ ├── ajv-keywords@2.0.1-beta.1 
│ ├── bluebird-lst@1.0.1 
│ ├── chromium-pickle-js@0.2.0 
│ ├── cuint@0.2.2 
│ ├── electron-builder-core@13.6.0 
│ ├── electron-builder-http@15.0.1 
│ ├─┬ electron-builder-util@15.0.1 
│ │ ├── ini@1.3.4 
│ │ ├─┬ node-emoji@1.5.1 
│ │ │ └── string.prototype.codepointat@0.2.0 
│ │ ├─┬ source-map-support@0.4.11 
│ │ │ └── source-map@0.5.6 
│ │ ├── stat-mode@0.2.2 
│ │ └─┬ tunnel-agent@0.6.0 
│ │   └── safe-buffer@5.0.1 
│ ├─┬ electron-download-tf@4.0.0 
│ │ ├── fs-extra@2.0.0 
│ │ ├── minimist@1.2.0 
│ │ ├── path-exists@3.0.0 
│ │ └── sumchecker@2.0.1 
│ ├─┬ electron-macos-sign@1.6.0 
│ │ └── compare-version@0.1.2 
│ ├─┬ electron-publish@15.0.1 
│ │ ├── mime@1.3.4 
│ │ └── progress-ex@2.0.0 
│ ├─┬ fs-extra-p@4.0.2 
│ │ └── fs-extra@2.0.0 
│ ├── hosted-git-info@2.2.0 
│ ├─┬ is-ci@1.0.10 
│ │ └── ci-info@1.0.0 
│ ├── isbinaryfile@3.0.2 
│ ├─┬ js-yaml@3.8.2 
│ │ ├─┬ argparse@1.0.9 
│ │ │ └── sprintf-js@1.0.3 
│ │ └── esprima@3.1.3 
│ ├─┬ minimatch@3.0.3 
│ │ └─┬ brace-expansion@1.1.6 
│ │   ├── balanced-match@0.4.2 
│ │   └── concat-map@0.0.1 
│ ├── node-forge@0.7.0 
│ ├─┬ normalize-package-data@2.3.6 
│ │ ├─┬ 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.2 
│ │   └── spdx-expression-parse@1.0.4 
│ ├─┬ parse-color@1.0.0 
│ │ └── color-convert@0.5.3 
│ ├─┬ plist@2.0.1 
│ │ ├── base64-js@1.1.2 
│ │ ├── xmlbuilder@8.2.2 
│ │ └── xmldom@0.1.27 
│ ├─┬ sanitize-filename@1.6.1 
│ │ └─┬ truncate-utf8-bytes@1.0.2 
│ │   └── utf8-byte-length@1.0.4 
│ ├── semver@5.3.0 
│ ├─┬ update-notifier@2.1.0 
│ │ ├─┬ boxen@1.0.0 
│ │ │ ├── ansi-align@1.1.0 
│ │ │ ├── camelcase@4.0.0 
│ │ │ ├── cli-boxes@1.0.0 
│ │ │ ├─┬ string-width@2.0.0 
│ │ │ │ └── is-fullwidth-code-point@2.0.0 
│ │ │ ├─┬ term-size@0.1.1 
│ │ │ │ └─┬ execa@0.4.0 
│ │ │ │   ├── cross-spawn-async@2.2.5 
│ │ │ │   ├── npm-run-path@1.0.0 
│ │ │ │   ├── path-key@1.0.0 
│ │ │ │   └── strip-eof@1.0.0 
│ │ │ └── widest-line@1.0.0 
│ │ ├─┬ configstore@3.0.0 
│ │ │ ├── dot-prop@4.1.1 
│ │ │ ├─┬ unique-string@1.0.0 
│ │ │ │ └── crypto-random-string@1.0.0 
│ │ │ └─┬ write-file-atomic@1.3.1 
│ │ │   └── slide@1.1.6 
│ │ ├── is-npm@1.0.0 
│ │ ├─┬ latest-version@3.0.0 
│ │ │ └─┬ package-json@3.1.0 
│ │ │   ├─┬ got@6.7.1 
│ │ │   │ ├─┬ create-error-class@3.0.2 
│ │ │   │ │ └── capture-stack-trace@1.0.0 
│ │ │   │ ├── duplexer3@0.1.4 
│ │ │   │ ├── get-stream@3.0.0 
│ │ │   │ ├── is-redirect@1.0.0 
│ │ │   │ ├── is-retry-allowed@1.1.0 
│ │ │   │ ├── lowercase-keys@1.0.0 
│ │ │   │ ├── timed-out@4.0.1 
│ │ │   │ ├── unzip-response@2.0.1 
│ │ │   │ └─┬ url-parse-lax@1.0.0 
│ │ │   │   └── prepend-http@1.0.4 
│ │ │   ├── registry-auth-token@3.1.0 
│ │ │   └── registry-url@3.1.0 
│ │ ├── lazy-req@2.0.0 
│ │ ├── semver-diff@2.1.0 
│ │ └── xdg-basedir@3.0.0 
│ ├─┬ uuid-1345@0.99.6 
│ │ └── macaddress@0.2.8 
│ └─┬ yargs@7.0.1 
│   ├── camelcase@3.0.0 
│   ├─┬ cliui@3.2.0 
│   │ └── wrap-ansi@2.1.0 
│   ├── decamelize@1.2.0 
│   ├── get-caller-file@1.0.2 
│   ├─┬ os-locale@1.4.0 
│   │ └─┬ lcid@1.0.0 
│   │   └── invert-kv@1.0.0 
│   ├─┬ read-pkg-up@1.0.1 
│   │ ├── find-up@1.1.2 
│   │ └─┬ read-pkg@1.1.0 
│   │   ├─┬ load-json-file@1.1.0 
│   │   │ └─┬ strip-bom@2.0.0 
│   │   │   └── is-utf8@0.2.1 
│   │   └── path-type@1.1.0 
│   ├── require-directory@2.1.1 
│   ├── require-main-filename@1.0.1 
│   ├── set-blocking@2.0.0 
│   ├─┬ string-width@1.0.2 
│   │ ├── code-point-at@1.1.0 
│   │ └── is-fullwidth-code-point@1.0.0 
│   ├── which-module@1.0.0 
│   ├── y18n@3.2.1 
│   └─┬ yargs-parser@5.0.0 
│     └── camelcase@3.0.0 
@belltown
Copy link

belltown commented Mar 10, 2017

I have the same problem with electron-builder 15.2.0.

Versions:

$ npm --version
4.4.1
$ npm list --depth=0
violetbug@0.0.4 /home/Documents/github/violetbug/source
├── electron@1.6.2
└── electron-builder@15.2.0

npm ERR! peer dep missing: ajv@>=5.0.3-beta.0, required by ajv-keywords@2.0.1-beta.1

I'm running on Ubuntu 16.10, targeting Windows and Linux.

This is what happens when I attempt to install:

$ rm -rf node_modules
$ npm cache clean
$ npm install

> electron@1.6.2 postinstall /home/Documents/github/violetbug/source/node_modules/electron
> node install.js

violetbug@0.0.4 /home/Documents/github/violetbug/source
├─┬ electron@1.6.2 
│ ├─┬ electron-download@3.3.0 
│ │ ├─┬ debug@2.6.2 
│ │ │ └── ms@0.7.2 
│ │ ├─┬ fs-extra@0.30.0 
│ │ │ ├── graceful-fs@4.1.11 
│ │ │ ├── jsonfile@2.4.0 
│ │ │ ├── klaw@1.3.1 
│ │ │ ├── path-is-absolute@1.0.1 
│ │ │ └─┬ rimraf@2.6.1 
│ │ │   └─┬ glob@7.1.1 
│ │ │     ├── fs.realpath@1.0.0 
│ │ │     ├─┬ inflight@1.0.6 
│ │ │     │ └── wrappy@1.0.2 
│ │ │     └── once@1.4.0 
│ │ ├── home-path@1.0.3 
│ │ ├── minimist@1.2.0 
│ │ ├─┬ nugget@2.0.1 
│ │ │ ├─┬ pretty-bytes@1.0.4 
│ │ │ │ ├── get-stdin@4.0.1 
│ │ │ │ └─┬ meow@3.7.0 
│ │ │ │   ├─┬ camelcase-keys@2.1.0 
│ │ │ │   │ └── camelcase@2.1.1 
│ │ │ │   ├─┬ loud-rejection@1.6.0 
│ │ │ │   │ ├─┬ currently-unhandled@0.4.1 
│ │ │ │   │ │ └── array-find-index@1.0.2 
│ │ │ │   │ └── signal-exit@3.0.2 
│ │ │ │   ├── map-obj@1.0.1 
│ │ │ │   ├── object-assign@4.1.1 
│ │ │ │   ├─┬ redent@1.0.0 
│ │ │ │   │ ├─┬ indent-string@2.1.0 
│ │ │ │   │ │ └─┬ repeating@2.0.1 
│ │ │ │   │ │   └── is-finite@1.0.2 
│ │ │ │   │ └── strip-indent@1.0.1 
│ │ │ │   └── trim-newlines@1.0.0 
│ │ │ ├─┬ progress-stream@1.2.0 
│ │ │ │ ├── speedometer@0.1.4 
│ │ │ │ └─┬ through2@0.2.3 
│ │ │ │   ├─┬ readable-stream@1.1.14 
│ │ │ │   │ └── isarray@0.0.1 
│ │ │ │   └─┬ xtend@2.1.2 
│ │ │ │     └── object-keys@0.4.0 
│ │ │ ├─┬ request@2.81.0 
│ │ │ │ ├── aws-sign2@0.6.0 
│ │ │ │ ├── aws4@1.6.0 
│ │ │ │ ├── caseless@0.12.0 
│ │ │ │ ├─┬ combined-stream@1.0.5 
│ │ │ │ │ └── delayed-stream@1.0.0 
│ │ │ │ ├── extend@3.0.0 
│ │ │ │ ├── forever-agent@0.6.1 
│ │ │ │ ├─┬ form-data@2.1.2 
│ │ │ │ │ └── asynckit@0.4.0 
│ │ │ │ ├─┬ har-validator@4.2.1 
│ │ │ │ │ ├── ajv@4.11.4 
│ │ │ │ │ └── har-schema@1.0.5 
│ │ │ │ ├─┬ hawk@3.1.3 
│ │ │ │ │ ├── boom@2.10.1 
│ │ │ │ │ ├── cryptiles@2.0.5 
│ │ │ │ │ ├── hoek@2.16.3 
│ │ │ │ │ └── sntp@1.0.9 
│ │ │ │ ├─┬ http-signature@1.1.1 
│ │ │ │ │ ├── assert-plus@0.2.0 
│ │ │ │ │ ├─┬ jsprim@1.3.1 
│ │ │ │ │ │ ├── extsprintf@1.0.2 
│ │ │ │ │ │ ├── json-schema@0.2.3 
│ │ │ │ │ │ └── verror@1.3.6 
│ │ │ │ │ └─┬ sshpk@1.11.0 
│ │ │ │ │   ├── asn1@0.2.3 
│ │ │ │ │   ├── assert-plus@1.0.0 
│ │ │ │ │   ├── bcrypt-pbkdf@1.0.1 
│ │ │ │ │   ├─┬ dashdash@1.14.1 
│ │ │ │ │   │ └── assert-plus@1.0.0 
│ │ │ │ │   ├── ecc-jsbn@0.1.1 
│ │ │ │ │   ├─┬ getpass@0.1.6 
│ │ │ │ │   │ └── assert-plus@1.0.0 
│ │ │ │ │   ├── jodid25519@1.0.2 
│ │ │ │ │   ├── jsbn@0.1.1 
│ │ │ │ │   └── tweetnacl@0.14.5 
│ │ │ │ ├── is-typedarray@1.0.0 
│ │ │ │ ├── isstream@0.1.2 
│ │ │ │ ├── json-stringify-safe@5.0.1 
│ │ │ │ ├─┬ mime-types@2.1.14 
│ │ │ │ │ └── mime-db@1.26.0 
│ │ │ │ ├── oauth-sign@0.8.2 
│ │ │ │ ├── performance-now@0.2.0 
│ │ │ │ ├── qs@6.4.0 
│ │ │ │ ├── stringstream@0.0.5 
│ │ │ │ ├─┬ tough-cookie@2.3.2 
│ │ │ │ │ └── punycode@1.4.1 
│ │ │ │ └── uuid@3.0.1 
│ │ │ ├── single-line-log@1.1.2 
│ │ │ └── throttleit@0.0.2 
│ │ ├─┬ path-exists@2.1.0 
│ │ │ └─┬ pinkie-promise@2.0.1 
│ │ │   └── pinkie@2.0.4 
│ │ ├─┬ rc@1.1.7 
│ │ │ ├── deep-extend@0.4.1 
│ │ │ └── strip-json-comments@2.0.1 
│ │ └─┬ sumchecker@1.3.0 
│ │   └── es6-promise@4.1.0 
│ └─┬ extract-zip@1.6.0 
│   ├─┬ concat-stream@1.5.0 
│   │ ├── inherits@2.0.3 
│   │ ├─┬ readable-stream@2.0.6 
│   │ │ ├── core-util-is@1.0.2 
│   │ │ ├── isarray@1.0.0 
│   │ │ ├── process-nextick-args@1.0.7 
│   │ │ ├── string_decoder@0.10.31 
│   │ │ └── util-deprecate@1.0.2 
│   │ └── typedarray@0.0.6 
│   ├── debug@0.7.4 
│   ├─┬ mkdirp@0.5.0 
│   │ └── minimist@0.0.8 
│   └─┬ yauzl@2.4.1 
│     └─┬ fd-slicer@1.0.1 
│       └── pend@1.2.0 
└─┬ electron-builder@15.2.0 
  ├─┬ 7zip-bin@2.0.4 
  │ └── 7zip-bin-linux@1.0.3 
  ├─┬ UNMET PEER DEPENDENCY ajv@5.0.3-beta.0
  │ ├── co@4.6.0 
  │ └─┬ json-stable-stringify@1.0.1 
  │   └── jsonify@0.0.0 
  ├── ajv-keywords@2.0.1-beta.1 
  ├─┬ bluebird-lst@1.0.1 
  │ └── bluebird@3.5.0 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├─┬ has-ansi@2.0.0 
  │ │ └── ansi-regex@2.1.1 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├── chromium-pickle-js@0.2.0 
  ├── cuint@0.2.2 
  ├── electron-builder-core@15.2.0 
  ├─┬ electron-builder-http@15.0.1 
  │ └── debug@2.6.1 
  ├─┬ electron-builder-util@15.2.0 
  │ ├── debug@2.6.1 
  │ ├── ini@1.3.4 
  │ ├─┬ node-emoji@1.5.1 
  │ │ └── string.prototype.codepointat@0.2.0 
  │ ├─┬ source-map-support@0.4.11 
  │ │ └── source-map@0.5.6 
  │ ├── stat-mode@0.2.2 
  │ └─┬ tunnel-agent@0.6.0 
  │   └── safe-buffer@5.0.1 
  ├─┬ electron-download-tf@4.0.0 
  │ ├── fs-extra@2.0.0 
  │ ├── path-exists@3.0.0 
  │ └── sumchecker@2.0.1 
  ├─┬ electron-macos-sign@1.6.0 
  │ └── compare-version@0.1.2 
  ├─┬ electron-publish@15.2.0 
  │ ├── mime@1.3.4 
  │ └── progress-ex@2.0.0 
  ├─┬ fs-extra-p@4.0.2 
  │ └── fs-extra@2.0.0 
  ├── hosted-git-info@2.2.0 
  ├─┬ is-ci@1.0.10 
  │ └── ci-info@1.0.0 
  ├── isbinaryfile@3.0.2 
  ├─┬ js-yaml@3.8.2 
  │ ├─┬ argparse@1.0.9 
  │ │ └── sprintf-js@1.0.3 
  │ └── esprima@3.1.3 
  ├─┬ minimatch@3.0.3 
  │ └─┬ brace-expansion@1.1.6 
  │   ├── balanced-match@0.4.2 
  │   └── concat-map@0.0.1 
  ├── node-forge@0.7.0 
  ├─┬ normalize-package-data@2.3.6 
  │ ├─┬ 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.2 
  │   └── spdx-expression-parse@1.0.4 
  ├─┬ parse-color@1.0.0 
  │ └── color-convert@0.5.3 
  ├─┬ plist@2.0.1 
  │ ├── base64-js@1.1.2 
  │ ├── xmlbuilder@8.2.2 
  │ └── xmldom@0.1.27 
  ├─┬ sanitize-filename@1.6.1 
  │ └─┬ truncate-utf8-bytes@1.0.2 
  │   └── utf8-byte-length@1.0.4 
  ├── semver@5.3.0 
  ├─┬ update-notifier@2.1.0 
  │ ├─┬ boxen@1.0.0 
  │ │ ├── ansi-align@1.1.0 
  │ │ ├── camelcase@4.0.0 
  │ │ ├── cli-boxes@1.0.0 
  │ │ ├─┬ string-width@2.0.0 
  │ │ │ └── is-fullwidth-code-point@2.0.0 
  │ │ ├─┬ term-size@0.1.1 
  │ │ │ └─┬ execa@0.4.0 
  │ │ │   ├─┬ cross-spawn-async@2.2.5 
  │ │ │   │ ├─┬ lru-cache@4.0.2 
  │ │ │   │ │ ├── pseudomap@1.0.2 
  │ │ │   │ │ └── yallist@2.0.0 
  │ │ │   │ └─┬ which@1.2.12 
  │ │ │   │   └── isexe@1.1.2 
  │ │ │   ├── is-stream@1.1.0 
  │ │ │   ├── npm-run-path@1.0.0 
  │ │ │   ├── path-key@1.0.0 
  │ │ │   └── strip-eof@1.0.0 
  │ │ └── widest-line@1.0.0 
  │ ├─┬ configstore@3.0.0 
  │ │ ├─┬ dot-prop@4.1.1 
  │ │ │ └── is-obj@1.0.1 
  │ │ ├─┬ unique-string@1.0.0 
  │ │ │ └── crypto-random-string@1.0.0 
  │ │ └─┬ write-file-atomic@1.3.1 
  │ │   ├── imurmurhash@0.1.4 
  │ │   └── slide@1.1.6 
  │ ├── is-npm@1.0.0 
  │ ├─┬ latest-version@3.0.0 
  │ │ └─┬ package-json@3.1.0 
  │ │   ├─┬ got@6.7.1 
  │ │   │ ├─┬ create-error-class@3.0.2 
  │ │   │ │ └── capture-stack-trace@1.0.0 
  │ │   │ ├── duplexer3@0.1.4 
  │ │   │ ├── get-stream@3.0.0 
  │ │   │ ├── is-redirect@1.0.0 
  │ │   │ ├── is-retry-allowed@1.1.0 
  │ │   │ ├── lowercase-keys@1.0.0 
  │ │   │ ├── timed-out@4.0.1 
  │ │   │ ├── unzip-response@2.0.1 
  │ │   │ └─┬ url-parse-lax@1.0.0 
  │ │   │   └── prepend-http@1.0.4 
  │ │   ├── registry-auth-token@3.1.0 
  │ │   └── registry-url@3.1.0 
  │ ├── lazy-req@2.0.0 
  │ ├── semver-diff@2.1.0 
  │ └── xdg-basedir@3.0.0 
  ├─┬ uuid-1345@0.99.6 
  │ └── macaddress@0.2.8 
  └─┬ yargs@7.0.2 
    ├── camelcase@3.0.0 
    ├─┬ cliui@3.2.0 
    │ └── wrap-ansi@2.1.0 
    ├── decamelize@1.2.0 
    ├── get-caller-file@1.0.2 
    ├─┬ os-locale@1.4.0 
    │ └─┬ lcid@1.0.0 
    │   └── invert-kv@1.0.0 
    ├─┬ read-pkg-up@1.0.1 
    │ ├── find-up@1.1.2 
    │ └─┬ read-pkg@1.1.0 
    │   ├─┬ load-json-file@1.1.0 
    │   │ ├─┬ parse-json@2.2.0 
    │   │ │ └─┬ error-ex@1.3.1 
    │   │ │   └── is-arrayish@0.2.1 
    │   │ ├── pify@2.3.0 
    │   │ └─┬ strip-bom@2.0.0 
    │   │   └── is-utf8@0.2.1 
    │   └── path-type@1.1.0 
    ├── require-directory@2.1.1 
    ├── require-main-filename@1.0.1 
    ├── set-blocking@2.0.0 
    ├─┬ string-width@1.0.2 
    │ ├── code-point-at@1.1.0 
    │ └─┬ is-fullwidth-code-point@1.0.0 
    │   └── number-is-nan@1.0.1 
    ├── which-module@1.0.0 
    ├── y18n@3.2.1 
    └─┬ yargs-parser@5.0.0 
      └── camelcase@3.0.0 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@^1.0.1 (node_modules/7zip-bin/node_modules/7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@^2.0.2 (node_modules/7zip-bin/node_modules/7zip-bin-win):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-win@2.0.2: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ajv-keywords@2.0.1-beta.1 requires a peer of ajv@>=5.0.3-beta.0 but none was installed.
$ 

Here is my package.json file:

{
  "name": "violetbug",
  "productName": "VioletBug",
  "version": "0.0.4",
  "private": true,
  "description": "VioletBug -- A Roku Debugger Graphical Interface",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "test": "echo If it works, it works",
    "dist-appimage": "build --linux AppImage",
    "dist-deb": "build --linux deb",
    "dist-rpm": "build --linux rpm",
    "dist-win": "build --win"
  },
  "build": {
    "appId": "tk.belltown-roku.violetbug",
    "directories": {
      "buildResources": "images",
      "output": "../dist/"
    },
    "nsis": {
      "oneClick": true
    },
    "win": {},
    "linux": {
      "target": [
        "AppImage",
        "deb",
        "rpm"
      ],
      "category": "Development",
      "vendor": "Belltown",
      "description": "A cross-platform Roku Debugger graphical interface",
      "icon": "."
    }
  },
  "keywords": [
    "PurpleBug",
    "VioletBug",
    "Roku",
    "debugger",
    "debug",
    "debugger",
    "Telnet"
  ],
  "copyright": "Copyright © 2017 Belltown",
  "license": "MIT",
  "author": {
    "name": "Belltown",
    "email": "nospam@gmail.com",
    "url": "http://belltown-roku.tk/VioletBug"
  },
  "homepage": "http://belltown-roku.tk/VioletBug",
  "repository": {
    "type": "git",
    "url": "https://github.com/belltown/violetbug"
  },
  "bugs": {
    "url": "https://github.com/belltown/violetbug/issues"
  },
  "devDependencies": {
    "electron": "1.6.2",
    "electron-builder": "15.2.0"
  }
}

As a workaround I can get it to work if I include the following line in my package.json devDependencies:

"ajv": "5.0.3-beta.0",

However, I don't think I should have to include stuff in my package.json file for dependencies of dependencies of my dependencies.

develar added a commit to develar/electron-builder that referenced this issue Mar 11, 2017
@salomvary
Copy link
Contributor

I'm still seeing this when installing electron-builder 15.3.0:

npm WARN ajv-keywords@2.0.1-beta.1 requires a peer of ajv@>=5.0.3-beta.0 but none was installed.

Npm shrinkwrap also fails hard on missing ajv@>=5.0.3-beta.0:

npm ERR! Please correct and try again.
npm ERR! peer invalid: ajv@>=5.0.3-beta.0, required by ajv-keywords@2.0.1-beta.1

@belltown
Copy link

belltown commented Mar 12, 2017

I'm getting the same error again now with electron-builder 15.3.0. What's really weird though is that I could swear that I tried it earlier this morning and everything worked perfectly.

rm -rf node_modules
~/Documents/github/violetbug/source$ npm cache clean
~/Documents/github/violetbug/source$ npm install

> electron@1.6.2 postinstall /home/Documents/github/violetbug/source/node_modules/electron
> node install.js

violetbug@0.0.4 /home/Documents/github/violetbug/source
├─┬ electron@1.6.2 
│ ├─┬ electron-download@3.3.0 
│ │ ├─┬ fs-extra@0.30.0 
│ │ │ ├── klaw@1.3.1 
│ │ │ ├── path-is-absolute@1.0.1 
│ │ │ └─┬ rimraf@2.6.1 
│ │ │   └─┬ glob@7.1.1 
│ │ │     └── fs.realpath@1.0.0 
│ │ ├── home-path@1.0.3 
│ │ ├─┬ nugget@2.0.1 
│ │ │ ├─┬ pretty-bytes@1.0.4 
│ │ │ │ ├── get-stdin@4.0.1 
│ │ │ │ └─┬ meow@3.7.0 
│ │ │ │   ├─┬ camelcase-keys@2.1.0 
│ │ │ │   │ └── camelcase@2.1.1 
│ │ │ │   ├─┬ loud-rejection@1.6.0 
│ │ │ │   │ ├─┬ currently-unhandled@0.4.1 
│ │ │ │   │ │ └── array-find-index@1.0.2 
│ │ │ │   │ └── signal-exit@3.0.2 
│ │ │ │   ├── map-obj@1.0.1 
│ │ │ │   ├── object-assign@4.1.1 
│ │ │ │   ├─┬ redent@1.0.0 
│ │ │ │   │ ├─┬ indent-string@2.1.0 
│ │ │ │   │ │ └─┬ repeating@2.0.1 
│ │ │ │   │ │   └── is-finite@1.0.2 
│ │ │ │   │ └── strip-indent@1.0.1 
│ │ │ │   └── trim-newlines@1.0.0 
│ │ │ ├─┬ progress-stream@1.2.0 
│ │ │ │ ├── speedometer@0.1.4 
│ │ │ │ └─┬ through2@0.2.3 
│ │ │ │   └─┬ xtend@2.1.2 
│ │ │ │     └── object-keys@0.4.0 
│ │ │ ├─┬ request@2.81.0 
│ │ │ │ ├── aws-sign2@0.6.0 
│ │ │ │ ├── aws4@1.6.0 
│ │ │ │ ├── caseless@0.12.0 
│ │ │ │ ├─┬ combined-stream@1.0.5 
│ │ │ │ │ └── delayed-stream@1.0.0 
│ │ │ │ ├── extend@3.0.0 
│ │ │ │ ├── forever-agent@0.6.1 
│ │ │ │ ├─┬ form-data@2.1.2 
│ │ │ │ │ └── asynckit@0.4.0 
│ │ │ │ ├─┬ har-validator@4.2.1 
│ │ │ │ │ ├── ajv@4.11.5 
│ │ │ │ │ └── har-schema@1.0.5 
│ │ │ │ ├─┬ hawk@3.1.3 
│ │ │ │ │ ├── boom@2.10.1 
│ │ │ │ │ ├── cryptiles@2.0.5 
│ │ │ │ │ ├── hoek@2.16.3 
│ │ │ │ │ └── sntp@1.0.9 
│ │ │ │ ├─┬ http-signature@1.1.1 
│ │ │ │ │ ├── assert-plus@0.2.0 
│ │ │ │ │ ├─┬ jsprim@1.3.1 
│ │ │ │ │ │ ├── extsprintf@1.0.2 
│ │ │ │ │ │ ├── json-schema@0.2.3 
│ │ │ │ │ │ └── verror@1.3.6 
│ │ │ │ │ └─┬ sshpk@1.11.0 
│ │ │ │ │   ├── asn1@0.2.3 
│ │ │ │ │   ├── assert-plus@1.0.0 
│ │ │ │ │   ├── bcrypt-pbkdf@1.0.1 
│ │ │ │ │   ├─┬ dashdash@1.14.1 
│ │ │ │ │   │ └── assert-plus@1.0.0 
│ │ │ │ │   ├── ecc-jsbn@0.1.1 
│ │ │ │ │   ├─┬ getpass@0.1.6 
│ │ │ │ │   │ └── assert-plus@1.0.0 
│ │ │ │ │   ├── jodid25519@1.0.2 
│ │ │ │ │   ├── jsbn@0.1.1 
│ │ │ │ │   └── tweetnacl@0.14.5 
│ │ │ │ ├── is-typedarray@1.0.0 
│ │ │ │ ├── isstream@0.1.2 
│ │ │ │ ├── json-stringify-safe@5.0.1 
│ │ │ │ ├─┬ mime-types@2.1.14 
│ │ │ │ │ └── mime-db@1.26.0 
│ │ │ │ ├── oauth-sign@0.8.2 
│ │ │ │ ├── performance-now@0.2.0 
│ │ │ │ ├── qs@6.4.0 
│ │ │ │ ├── stringstream@0.0.5 
│ │ │ │ ├─┬ tough-cookie@2.3.2 
│ │ │ │ │ └── punycode@1.4.1 
│ │ │ │ └── uuid@3.0.1 
│ │ │ ├── single-line-log@1.1.2 
│ │ │ └── throttleit@0.0.2 
│ │ ├─┬ path-exists@2.1.0 
│ │ │ └─┬ pinkie-promise@2.0.1 
│ │ │   └── pinkie@2.0.4 
│ │ ├─┬ rc@1.1.7 
│ │ │ ├── deep-extend@0.4.1 
│ │ │ └── strip-json-comments@2.0.1 
│ │ └─┬ sumchecker@1.3.1 
│ │   └── es6-promise@4.1.0 
│ └─┬ extract-zip@1.6.0 
│   ├─┬ concat-stream@1.5.0 
│   │ ├── inherits@2.0.3 
│   │ ├─┬ readable-stream@2.0.6 
│   │ │ ├── core-util-is@1.0.2 
│   │ │ ├── isarray@1.0.0 
│   │ │ ├── process-nextick-args@1.0.7 
│   │ │ ├── string_decoder@0.10.31 
│   │ │ └── util-deprecate@1.0.2 
│   │ └── typedarray@0.0.6 
│   ├── debug@0.7.4 
│   ├─┬ mkdirp@0.5.0 
│   │ └── minimist@0.0.8 
│   └─┬ yauzl@2.4.1 
│     └─┬ fd-slicer@1.0.1 
│       └── pend@1.2.0 
├─┬ electron-builder@15.3.0 
│ ├─┬ 7zip-bin@2.0.4 
│ │ └── 7zip-bin-linux@1.0.3 
│ ├─┬ UNMET PEER DEPENDENCY ajv@5.0.3-beta.0
│ │ ├── co@4.6.0 
│ │ └─┬ json-stable-stringify@1.0.1 
│ │   └── jsonify@0.0.0 
│ ├── ajv-keywords@2.0.1-beta.1 
│ ├─┬ bluebird-lst@1.0.1 
│ │ └── bluebird@3.5.0 
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── escape-string-regexp@1.0.5 
│ │ ├─┬ has-ansi@2.0.0 
│ │ │ └── ansi-regex@2.1.1 
│ │ ├── strip-ansi@3.0.1 
│ │ └── supports-color@2.0.0 
│ ├── chromium-pickle-js@0.2.0 
│ ├── cuint@0.2.2 
│ ├── electron-builder-core@15.3.0 
│ ├── electron-builder-http@15.3.0 
│ ├─┬ electron-builder-util@15.3.0 
│ │ ├── ini@1.3.4 
│ │ ├─┬ node-emoji@1.5.1 
│ │ │ └── string.prototype.codepointat@0.2.0 
│ │ ├─┬ source-map-support@0.4.11 
│ │ │ └── source-map@0.5.6 
│ │ ├── stat-mode@0.2.2 
│ │ └─┬ tunnel-agent@0.6.0 
│ │   └── safe-buffer@5.0.1 
│ ├─┬ electron-download-tf@4.0.0 
│ │ ├── fs-extra@2.0.0 
│ │ ├── path-exists@3.0.0 
│ │ └── sumchecker@2.0.2 
│ ├─┬ electron-macos-sign@1.6.0 
│ │ └── compare-version@0.1.2 
│ ├─┬ electron-publish@15.3.0 
│ │ ├── mime@1.3.4 
│ │ └── progress-ex@2.0.0 
│ ├─┬ fs-extra-p@4.0.2 
│ │ └── fs-extra@2.0.0 
│ ├── hosted-git-info@2.2.0 
│ ├─┬ is-ci@1.0.10 
│ │ └── ci-info@1.0.0 
│ ├── isbinaryfile@3.0.2 
│ ├─┬ js-yaml@3.8.2 
│ │ ├─┬ argparse@1.0.9 
│ │ │ └── sprintf-js@1.0.3 
│ │ └── esprima@3.1.3 
│ ├─┬ minimatch@3.0.3 
│ │ └─┬ brace-expansion@1.1.6 
│ │   ├── balanced-match@0.4.2 
│ │   └── concat-map@0.0.1 
│ ├── node-forge@0.7.0 
│ ├─┬ normalize-package-data@2.3.6 
│ │ ├─┬ 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.2 
│ │   └── spdx-expression-parse@1.0.4 
│ ├─┬ parse-color@1.0.0 
│ │ └── color-convert@0.5.3 
│ ├─┬ plist@2.0.1 
│ │ ├── base64-js@1.1.2 
│ │ ├── xmlbuilder@8.2.2 
│ │ └── xmldom@0.1.27 
│ ├─┬ sanitize-filename@1.6.1 
│ │ └─┬ truncate-utf8-bytes@1.0.2 
│ │   └── utf8-byte-length@1.0.4 
│ ├── semver@5.3.0 
│ ├─┬ update-notifier@2.1.0 
│ │ ├─┬ boxen@1.0.0 
│ │ │ ├── ansi-align@1.1.0 
│ │ │ ├── camelcase@4.0.0 
│ │ │ ├── cli-boxes@1.0.0 
│ │ │ ├─┬ string-width@2.0.0 
│ │ │ │ └── is-fullwidth-code-point@2.0.0 
│ │ │ ├─┬ term-size@0.1.1 
│ │ │ │ └─┬ execa@0.4.0 
│ │ │ │   ├─┬ cross-spawn-async@2.2.5 
│ │ │ │   │ ├─┬ lru-cache@4.0.2 
│ │ │ │   │ │ ├── pseudomap@1.0.2 
│ │ │ │   │ │ └── yallist@2.0.1 
│ │ │ │   │ └─┬ which@1.2.12 
│ │ │ │   │   └── isexe@1.1.2 
│ │ │ │   ├── is-stream@1.1.0 
│ │ │ │   ├── npm-run-path@1.0.0 
│ │ │ │   ├── path-key@1.0.0 
│ │ │ │   └── strip-eof@1.0.0 
│ │ │ └── widest-line@1.0.0 
│ │ ├─┬ configstore@3.0.0 
│ │ │ ├─┬ dot-prop@4.1.1 
│ │ │ │ └── is-obj@1.0.1 
│ │ │ ├─┬ unique-string@1.0.0 
│ │ │ │ └── crypto-random-string@1.0.0 
│ │ │ └─┬ write-file-atomic@1.3.1 
│ │ │   ├── imurmurhash@0.1.4 
│ │ │   └── slide@1.1.6 
│ │ ├── is-npm@1.0.0 
│ │ ├─┬ latest-version@3.0.0 
│ │ │ └─┬ package-json@3.1.0 
│ │ │   ├─┬ got@6.7.1 
│ │ │   │ ├─┬ create-error-class@3.0.2 
│ │ │   │ │ └── capture-stack-trace@1.0.0 
│ │ │   │ ├── duplexer3@0.1.4 
│ │ │   │ ├── get-stream@3.0.0 
│ │ │   │ ├── is-redirect@1.0.0 
│ │ │   │ ├── is-retry-allowed@1.1.0 
│ │ │   │ ├── lowercase-keys@1.0.0 
│ │ │   │ ├── timed-out@4.0.1 
│ │ │   │ ├── unzip-response@2.0.1 
│ │ │   │ └─┬ url-parse-lax@1.0.0 
│ │ │   │   └── prepend-http@1.0.4 
│ │ │   ├── registry-auth-token@3.1.0 
│ │ │   └── registry-url@3.1.0 
│ │ ├── lazy-req@2.0.0 
│ │ ├── semver-diff@2.1.0 
│ │ └── xdg-basedir@3.0.0 
│ ├─┬ uuid-1345@0.99.6 
│ │ └── macaddress@0.2.8 
│ └─┬ yargs@7.0.2 
│   ├── camelcase@3.0.0 
│   ├─┬ cliui@3.2.0 
│   │ └── wrap-ansi@2.1.0 
│   ├── decamelize@1.2.0 
│   ├── get-caller-file@1.0.2 
│   ├─┬ os-locale@1.4.0 
│   │ └─┬ lcid@1.0.0 
│   │   └── invert-kv@1.0.0 
│   ├─┬ read-pkg-up@1.0.1 
│   │ ├── find-up@1.1.2 
│   │ └─┬ read-pkg@1.1.0 
│   │   ├─┬ load-json-file@1.1.0 
│   │   │ ├─┬ parse-json@2.2.0 
│   │   │ │ └─┬ error-ex@1.3.1 
│   │   │ │   └── is-arrayish@0.2.1 
│   │   │ ├── pify@2.3.0 
│   │   │ └─┬ strip-bom@2.0.0 
│   │   │   └── is-utf8@0.2.1 
│   │   └── path-type@1.1.0 
│   ├── require-directory@2.1.1 
│   ├── require-main-filename@1.0.1 
│   ├── set-blocking@2.0.0 
│   ├─┬ string-width@1.0.2 
│   │ ├── code-point-at@1.1.0 
│   │ └─┬ is-fullwidth-code-point@1.0.0 
│   │   └── number-is-nan@1.0.1 
│   ├── which-module@1.0.0 
│   ├── y18n@3.2.1 
│   └─┬ yargs-parser@5.0.0 
│     └── camelcase@3.0.0 
└─┬ electron-packager@8.5.2 
  ├─┬ asar@0.13.0 
  │ ├─┬ commander@2.9.0 
  │ │ └── graceful-readlink@1.0.1 
  │ ├─┬ glob@6.0.4 
  │ │ ├─┬ inflight@1.0.6 
  │ │ │ └── wrappy@1.0.2 
  │ │ └── once@1.4.0 
  │ ├─┬ mksnapshot@0.3.1 
  │ │ ├─┬ decompress-zip@0.3.0 
  │ │ │ ├─┬ binary@0.3.0 
  │ │ │ │ ├── buffers@0.1.1 
  │ │ │ │ └─┬ chainsaw@0.1.0 
  │ │ │ │   └── traverse@0.3.9 
  │ │ │ ├── mkpath@0.1.0 
  │ │ │ ├─┬ nopt@3.0.6 
  │ │ │ │ └── abbrev@1.1.0 
  │ │ │ ├── q@1.4.1 
  │ │ │ ├─┬ readable-stream@1.1.14 
  │ │ │ │ └── isarray@0.0.1 
  │ │ │ └─┬ touch@0.0.3 
  │ │ │   └── nopt@1.0.10 
  │ │ └── fs-extra@0.26.7 
  │ └─┬ tmp@0.0.28 
  │   └── os-tmpdir@1.0.2 
  ├─┬ debug@2.6.2 
  │ └── ms@0.7.2 
  ├─┬ electron-download@4.0.0 
  │ ├── path-exists@3.0.0 
  │ └── sumchecker@2.0.2 
  ├─┬ electron-osx-sign@0.4.4 
  │ └─┬ tempfile@1.1.1 
  │   └── uuid@2.0.3 
  ├─┬ fs-extra@2.0.0 
  │ ├── graceful-fs@4.1.11 
  │ └── jsonfile@2.4.0 
  ├─┬ get-package-info@1.0.0 
  │ ├── lodash.get@4.4.2 
  │ └─┬ read-pkg-up@2.0.0 
  │   ├─┬ find-up@2.1.0 
  │   │ └─┬ locate-path@2.0.0 
  │   │   ├─┬ p-locate@2.0.0 
  │   │   │ └── p-limit@1.1.0 
  │   │   └── path-exists@3.0.0 
  │   └─┬ read-pkg@2.0.0 
  │     ├─┬ load-json-file@2.0.0 
  │     │ └── strip-bom@3.0.0 
  │     └── path-type@2.0.0 
  ├── minimist@1.2.0 
  ├── rcedit@0.7.0 
  ├─┬ resolve@1.3.2 
  │ └── path-parse@1.0.5 
  └── run-series@1.1.4 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@^1.0.1 (node_modules/7zip-bin/node_modules/7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@^2.0.2 (node_modules/7zip-bin/node_modules/7zip-bin-win):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-win@2.0.2: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ajv-keywords@2.0.1-beta.1 requires a peer of ajv@>=5.0.3-beta.0 but none was installed.

@develar
Copy link
Member

develar commented Mar 12, 2017

It is just warning and doesn't lead to any issue. I will check again.

@bcomnes
Copy link
Contributor Author

bcomnes commented Mar 12, 2017

Yes, to be fair nothing seemed to be busted. At least on macOS Builds in my tests.

@belltown
Copy link

My program runs, but it is a bit disconcerting to see an npm ERR! listed when I run the npm list command:

$ npm list --depth=1
violetbug@0.0.4 /home/Documents/github/violetbug/source
├─┬ electron@1.6.2
│ ├── electron-download@3.3.0
│ └── extract-zip@1.6.0
├─┬ electron-builder@15.3.0
│ ├── 7zip-bin@2.0.4
│ ├── UNMET PEER DEPENDENCY ajv@5.0.3-beta.0
│ ├── ajv-keywords@2.0.1-beta.1
│ ├── bluebird-lst@1.0.1
│ ├── chalk@1.1.3
│ ├── chromium-pickle-js@0.2.0
│ ├── cuint@0.2.2
│ ├── electron-builder-core@15.3.0
│ ├── electron-builder-http@15.3.0
│ ├── electron-builder-util@15.3.0
│ ├── electron-download-tf@4.0.0
│ ├── electron-macos-sign@1.6.0
│ ├── electron-publish@15.3.0
│ ├── fs-extra-p@4.0.2
│ ├── hosted-git-info@2.2.0
│ ├── is-ci@1.0.10
│ ├── isbinaryfile@3.0.2
│ ├── js-yaml@3.8.2
│ ├── minimatch@3.0.3
│ ├── node-forge@0.7.0
│ ├── normalize-package-data@2.3.6
│ ├── parse-color@1.0.0
│ ├── plist@2.0.1
│ ├── sanitize-filename@1.6.1
│ ├── semver@5.3.0
│ ├── update-notifier@2.1.0
│ ├── uuid-1345@0.99.6
│ └── yargs@7.0.2
└─┬ electron-packager@8.5.2
  ├── asar@0.13.0
  ├── debug@2.6.2
  ├── electron-download@4.0.0
  ├── electron-osx-sign@0.4.4
  ├── fs-extra@2.0.0
  ├── get-package-info@1.0.0
  ├── minimist@1.2.0
  ├── rcedit@0.7.0
  ├── resolve@1.3.2
  └── run-series@1.1.4

npm ERR! peer dep missing: ajv@>=5.0.3-beta.0, required by ajv-keywords@2.0.1-beta.1

@salomvary
Copy link
Contributor

The remaining problem is not the warning on npm install but an error and non-zero exit status on npm shrinkwrap --dev.

Steps to reproduce:
https://gist.github.com/salomvary/b783d7934ec5351514678f4b0dac3274

Interestingly it is only reproducible if electron itself is present as a dependency. Without that things seem smooth (obviously not a solution:)

@develar
Copy link
Member

develar commented Mar 12, 2017

npm shrinkwrap --dev.

Why not use yarn :)?

@salomvary
Copy link
Contributor

Because I'm from 2016 :)

@flexiondotorg
Copy link
Contributor

flexiondotorg commented Mar 13, 2017

I've encountered the same issue on Ubuntu 16.04 building a very simple electron app.

npm --version
4.1.2
node --version
v7.7.2

@develar
Copy link
Member

develar commented Mar 17, 2017

We are not going to switch to stable ajv from beta. It is just a warning. Consider to use yarn if you want to get more clear warnings messages. ajv-validator/ajv-keywords#8

@salomvary
Copy link
Contributor

It is just a warning.

How does npm shrinkwrap printing out ERR! and exiting with non-zero status qualify as a warning? :)

@develar
Copy link
Member

develar commented Mar 17, 2017

npm shrinkwrap is broken by design. If you really need "locks down the versions of a package's dependencies" — use yarn instead of npm. Otherwise it is only "simulation" (sorry).

@salomvary
Copy link
Contributor

salomvary commented Mar 17, 2017

@develar While I disagree with it, I respect your opinion. Cheers!

Do you have any resources on "npm shrinkwrap's brokenness by design"? I'd like to learn more about this...

@bcomnes
Copy link
Contributor Author

bcomnes commented Mar 17, 2017

npm shrinkwrap is broken by design. If you really need "locks down the versions of a package's dependencies" — use yarn instead of npm. Otherwise it is only "simulation" (sorry).

We just started using shrinkwrap at work for a project. Do you know any good writing or articles that expand on this? Would be nice to learn from others mistakes than learn for ourselves.

@develar
Copy link
Member

develar commented Mar 17, 2017

@salomvary If you insist and don't want to use yarn — I can use stable version of ajv to make npm happy. Should I? Or you can migrate to yarn?

@develar
Copy link
Member

develar commented Mar 17, 2017

@bcomnes @salomvary Please see https://code.facebook.com/posts/1840075619545360 "Attempts at scaling the npm client"

npm/npm#5135 shrinkwrap simply doesn't support peer dependencies. I strongly suggest to not use npm and use yarn.

@bcomnes
Copy link
Contributor Author

bcomnes commented Mar 17, 2017

Thanks for the articles. Will read. I don't have a strong opinion at this point.

@develar
Copy link
Member

develar commented Mar 17, 2017

Yeach... if you will insist, I will just copy ajv-keywords into project or republish as npm module.

@epoberezkin Are you aware of this issue?

ajv-keywords cannot depends on ajv, because *** npm in this case can install 2 deps (one for your project as direct dependency and another one for ajv-keywords if versions are different). Yarn in this case will always install 1 version. *** npm.

So, are you really want to use *** npm or you can migrate to reliable, fast and predictable yarn?

@salomvary
Copy link
Contributor

If you insist and don't want to use yarn

@develar No, I do not insist. I'm not working on anything critical that depends on electron-builder and npm shrinkwrap working together. The purpose of my comments was to understand the situation and provide feedback.

@develar
Copy link
Member

develar commented Mar 17, 2017

@salomvary Ok. If it will leads to some issues for you — feel free to ping me to republish ajv-keywords.

@salomvary
Copy link
Contributor

@develar Cool, thanks a lot!

@belltown
Copy link

I think I see what is happening now. If my only dev dependency is electron-builder, then everything works -- no warnings. no errors. However, if I add a dev dependency that has a dependency on ajv (stable version), then I get an npm warning during install, and an ERR! during an npm list (this is probably what happens during a shrinking wrap as well, although that's not something I use).

Examining the node_modules folder hierarchy, I see that npm puts the stable ajv at the top level. It also puts the beta ajv-keywords (which has ajv as its peer dependency) at the top level. The beta ajv (peer dependency of ajv) is placed below electron-builder further down in the hierarchy. So when an npm list command is scanning the node_modules hierarchy, it comes across ajv-keywords and complains because, at this point, the only version of ajv it has encountered is the stable version. The beta ajv isn't encountered until later.

I don't believe npm is behaving sensibly in this case. If the stable ajv is at the top of the hierarchy, then both ajv beta and ajv-keywords beta should be placed below electron-builder so as not to interfere with anything that uses the stable version.

Alternatively, it could put both ajv beta and ajv-keywords beta at the top of the hierarchy, and place the stable ajv below the electron dependency that requires it. <--- This is what Yarn does!

I'm new to npm, but my guess at this point is that the problem lies with npm, possibly related to npm/npm#5135 as it pertains to peer dependencies, npm list, and perhaps the way beta dependencies are handled differently from stable dependencies.

I don't see that electron-builder, or ajv/ajv-keywords are doing anything wrong.

The workarounds from my end are to either include the requisite ajv beta package in my devDependencies, or to use the yarn. In the first case, I have to keep up with a dependency of a dependency, which defeats the whole purpose of having a dependency manager. In the second case, I'd have to specify that anyone building my program build it with yarn rather than npm to avoid npm warnings and errors. Some users may not be willing or ready to switch to another package manager. I don't know if there's a better way.

@develar
Copy link
Member

develar commented Mar 19, 2017

@belltown I believe that you should use yarn. Also, since you build electron app, you can get a lot of benefits of yarn clean command. Yes — we do our best to ignore weird stuff from node_modules, but we are not going to reinvent the wheel and, so, we ask users and rely on awesome yarn feature to cleanup node modules.

NPM is dead. Really. Do not use npm. It is only several seconds to install yarn. Several seconds that will save A LOT OF your and your contributors hours. Do not use npm. Use yarn (and do not forget to commit lockfile).

Disagree? Ook, electron-builder is not going to teach you or force to use some tool. I can republish/integrate ajv-keywords if you really want to use broken, slow and buggy npm.

@belltown
Copy link

Thanks for taking the time to respond, @develar. From what I've seen so far, yarn is far superior to npm, and I've started using it successfully. As I said, I don't think anything is "broken" in either electron-builder or ajv, etc. Rather, it seems like the issue is with the way npm works (or doesn't) in certain situations.

I'll change my build script to use yarn, and add a note to my build documentation that yarn is recommended, but can be changed to npm as long as npm peer dependency errors are resolved by adding to devDependencies (or ignored).

I think that is the best way. I was just trying to avoid imposing a yarn recommendation on others who didn't want to use it, but I totally understand and agree with your points.

@epoberezkin
Copy link

I've published updated version of ajv-keywords, is there still a problem?

@develar
Copy link
Member

develar commented Mar 19, 2017

@epoberezkin it fixes warn in case of yarn (thanks), but npm in any case are not happy because buggy.

@epoberezkin
Copy link

@develar npm works fine for me. I'm glad yarn works well for you.

@develar
Copy link
Member

develar commented Mar 19, 2017

@epoberezkin "if I add a dev dependency that has a dependency on ajv (stable version), then I get an npm warning during install, and an ERR! during an npm list "

Issue is that npm doesn't handle situation where there are several versions of ajv.

@epoberezkin
Copy link

@develar I think it gets fixed if you delete node_modules folder and then npm install. It seems like npm handles it ok for fresh install, but fails if it originally assumed there is only one version and then the second version appears. I am not 100% sure, but I think I had this issue and it gets resolved via fresh npm install. Am I wrong?

If I am correct, then it seems like an edge case to me rather than a bug.

@belltown
Copy link

belltown commented Mar 19, 2017

@epoberezkin

In my testing, I always ran:

rm -rf node_modules
npm clean
npm install

The error still happened, even with the deletion of node_modules and the npm cache.

Here's what I had in devDependencies:

  "devDependencies": {
    "electron": "1.6.2",
    "electron-builder": "15.6.4",
    "electron-packager": "8.5.2"
  }

Note, there is no problem if I remove electron from devDependencies.

However, there is a use of ajv stable beneath electron: (electron->electron-download->nugget->request->har-validator->ajv).

When npm installs, it puts the stable ajv at the top-level of node_modules, along with the beta ajv-keywords. The beta ajv is placed below electron-builder in the tree. I think 'npm list' gives an error because when it encounters the beta ajv-keywords at the top-level node_modules, it only sees the stable ajv at that point, not it's beta peer dependency.

It works with yarn because yarn places both ajv beta and ajv-keywords beta at the top of node_modules, and the stable ajv below the electron dependency that needs it (har-validator).

All this stuff is new to me, but I'm guessing it's a problem with how npm works, rather than the way electron-builder or ajv/ajv-keywords are specifying their dependencies.

I'm using yarn now and everything seems better now, but yes npm still shows 'WARN' on npm install and 'ERR!' on npm list.

@epoberezkin
Copy link

The issue seem to exist in 4.x versions of npm (flat node_modules, bundled with node 6-7), not in 2.x (tree node_modules, bundled with node 4). Probably worth filing issue to npm. The warning is only advisory though, and it doesn't affect code execution - electron-builder uses new ajv and new ajv-keywords, but because the latter is install to the root, npm ls shows this warning.

@epoberezkin
Copy link

On another hand, they can argue that this warning should be present to show versions inconsistency and to advise you not to use ajv-keywords in your app directly, without installing the compatible version? Inside dependencies it all works correctly though, as I wrote.

@belltown
Copy link

@epoberezkin. That's what I thought. I figured it had something to do with the changes npm made going from version 2 to 3 in which they use a different node_modules structure, and no longer automatically install peerDependencies like they used to. What I found odd was that electron-builder does include both ajv beta and ajv-keywords beta as dependencies, yet a package that uses electron-builder as well as some other package that uses ajv stable, reports an error (not warning), with npm list. Thanks for looking into this.

I don't have the time or interest to follow this though with npm. I'm happy with what I'm doing now. Thanks for looking into this.

@develar
Copy link
Member

develar commented Mar 19, 2017

to follow this though with npm

And you should not. Your node_modules should be as small as possible to reduce distributable app size. And only yarn can guarantee it (yarnpkg/yarn#2676).

@iam-mhaseeb
Copy link

I solved it by installing peer dependencies manually and it worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants