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 [email protected] requires a peer of ajv@>=5.0.3-beta.0 but none was installed.
─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ UNMET PEER DEPENDENCY [email protected]
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   ├─┬ [email protected] 
│ │   │ └── [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   ├─┬ [email protected] 
│ │ │   │ ├─┬ [email protected] 
│ │ │   │ │ └── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ └─┬ [email protected] 
│ │ │   │   └── [email protected] 
│ │ │   ├── [email protected] 
│ │ │   └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ └─┬ [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └─┬ [email protected] 
│   │   └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ └─┬ [email protected] 
│   │   ├─┬ [email protected] 
│   │   │ └─┬ [email protected] 
│   │   │   └── [email protected] 
│   │   └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   └─┬ [email protected] 
│     └── [email protected] 
@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
[email protected] /home/Documents/github/violetbug/source
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: ajv@>=5.0.3-beta.0, required by [email protected]

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

> [email protected] postinstall /home/Documents/github/violetbug/source/node_modules/electron
> node install.js

[email protected] /home/Documents/github/violetbug/source
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └─┬ [email protected] 
│ │ │     ├── [email protected] 
│ │ │     ├─┬ [email protected] 
│ │ │     │ └── [email protected] 
│ │ │     └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ ├─┬ [email protected] 
│ │ │ │   │ │ └── [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ ├─┬ [email protected] 
│ │ │ │   │ │ └─┬ [email protected] 
│ │ │ │   │ │   └── [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   └─┬ [email protected] 
│ │ │ │     └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ │ ├── [email protected] 
│ │ │ │ │ │ ├── [email protected] 
│ │ │ │ │ │ └── [email protected] 
│ │ │ │ │ └─┬ [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├─┬ [email protected] 
│ │ │ │ │   │ └── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├─┬ [email protected] 
│ │ │ │ │   │ └── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   └── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ └─┬ [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ └── [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   └─┬ [email protected] 
│     └─┬ [email protected] 
│       └── [email protected] 
└─┬ [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ UNMET PEER DEPENDENCY [email protected]
  │ ├── [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├── [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └─┬ [email protected] 
  │   ├── [email protected] 
  │   └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   ├─┬ [email protected] 
  │   │ └── [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   ├─┬ [email protected] 
  │ │ │   │ ├─┬ [email protected] 
  │ │ │   │ │ ├── [email protected] 
  │ │ │   │ │ └── [email protected] 
  │ │ │   │ └─┬ [email protected] 
  │ │ │   │   └── [email protected] 
  │ │ │   ├── [email protected] 
  │ │ │   ├── [email protected] 
  │ │ │   ├── [email protected] 
  │ │ │   └── [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├── [email protected] 
  │ │   └── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ ├─┬ [email protected] 
  │ │   │ │ └── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ ├── [email protected] 
  │ │   │ └─┬ [email protected] 
  │ │   │   └── [email protected] 
  │ │   ├── [email protected] 
  │ │   └── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  └─┬ [email protected] 
    ├── [email protected] 
    ├─┬ [email protected] 
    │ └── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├─┬ [email protected] 
    │ └─┬ [email protected] 
    │   └── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ └─┬ [email protected] 
    │   ├─┬ [email protected] 
    │   │ ├─┬ [email protected] 
    │   │ │ └─┬ [email protected] 
    │   │ │   └── [email protected] 
    │   │ ├── [email protected] 
    │   │ └─┬ [email protected] 
    │   │   └── [email protected] 
    │   └── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ └─┬ [email protected] 
    │   └── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    └─┬ [email protected] 
      └── [email protected] 

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 [email protected]: 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 [email protected]: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] 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": "[email protected]",
    "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 [email protected] 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 [email protected]

@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

> [email protected] postinstall /home/Documents/github/violetbug/source/node_modules/electron
> node install.js

[email protected] /home/Documents/github/violetbug/source
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └─┬ [email protected] 
│ │ │     └── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ ├─┬ [email protected] 
│ │ │ │   │ │ └── [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ ├─┬ [email protected] 
│ │ │ │   │ │ └─┬ [email protected] 
│ │ │ │   │ │   └── [email protected] 
│ │ │ │   │ └── [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   └─┬ [email protected] 
│ │ │ │     └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ ├── [email protected] 
│ │ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ │ ├── [email protected] 
│ │ │ │ │ │ ├── [email protected] 
│ │ │ │ │ │ └── [email protected] 
│ │ │ │ │ └─┬ [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├─┬ [email protected] 
│ │ │ │ │   │ └── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├─┬ [email protected] 
│ │ │ │ │   │ └── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   ├── [email protected] 
│ │ │ │ │   └── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├── [email protected] 
│ │ │ │ ├─┬ [email protected] 
│ │ │ │ │ └── [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ └─┬ [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ ├─┬ [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ ├── [email protected] 
│   │ │ └── [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   └─┬ [email protected] 
│     └─┬ [email protected] 
│       └── [email protected] 
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ UNMET PEER DEPENDENCY [email protected]
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   ├── [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └── [email protected] 
│ │ └─┬ [email protected] 
│ │   ├─┬ [email protected] 
│ │   │ └── [email protected] 
│ │   └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └─┬ [email protected] 
│ │   └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └─┬ [email protected] 
│ │ │ │   ├─┬ [email protected] 
│ │ │ │   │ ├─┬ [email protected] 
│ │ │ │   │ │ ├── [email protected] 
│ │ │ │   │ │ └── [email protected] 
│ │ │ │   │ └─┬ [email protected] 
│ │ │ │   │   └── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   ├── [email protected] 
│ │ │ │   └── [email protected] 
│ │ │ └── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ ├─┬ [email protected] 
│ │ │ │ └── [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   ├── [email protected] 
│ │ │   └── [email protected] 
│ │ ├── [email protected] 
│ │ ├─┬ [email protected] 
│ │ │ └─┬ [email protected] 
│ │ │   ├─┬ [email protected] 
│ │ │   │ ├─┬ [email protected] 
│ │ │   │ │ └── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ ├── [email protected] 
│ │ │   │ └─┬ [email protected] 
│ │ │   │   └── [email protected] 
│ │ │   ├── [email protected] 
│ │ │   └── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ └─┬ [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ └─┬ [email protected] 
│   │   └── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ └─┬ [email protected] 
│   │   ├─┬ [email protected] 
│   │   │ ├─┬ [email protected] 
│   │   │ │ └─┬ [email protected] 
│   │   │ │   └── [email protected] 
│   │   │ ├── [email protected] 
│   │   │ └─┬ [email protected] 
│   │   │   └── [email protected] 
│   │   └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   ├─┬ [email protected] 
│   │ ├── [email protected] 
│   │ └─┬ [email protected] 
│   │   └── [email protected] 
│   ├── [email protected] 
│   ├── [email protected] 
│   └─┬ [email protected] 
│     └── [email protected] 
└─┬ [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ └── [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ ├── [email protected] 
  │ │ │ │ └─┬ [email protected] 
  │ │ │ │   └── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   └── [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └─┬ [email protected] 
  │   ├─┬ [email protected] 
  │   │ └─┬ [email protected] 
  │   │   ├─┬ [email protected] 
  │   │   │ └── [email protected] 
  │   │   └── [email protected] 
  │   └─┬ [email protected] 
  │     ├─┬ [email protected] 
  │     │ └── [email protected] 
  │     └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  └── [email protected] 

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 [email protected]: 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 [email protected]: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] 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
[email protected] /home/Documents/github/violetbug/source
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── UNMET PEER DEPENDENCY [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
└─┬ [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  ├── [email protected]
  └── [email protected]

npm ERR! peer dep missing: ajv@>=5.0.3-beta.0, required by [email protected]

@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