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

Build fails due to peer depedency errors #611

Closed
ingro opened this issue Jul 27, 2016 · 9 comments · May be fixed by qcif/data-curator#563
Closed

Build fails due to peer depedency errors #611

ingro opened this issue Jul 27, 2016 · 9 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@ingro
Copy link

ingro commented Jul 27, 2016

  • Version: 5.17.0
  • Target: win32 x64

Hello, I'm trying to use electron-builder to package my app. Before switching to the suggested structure (two package.json) I'm trying with the current one but when I launch the build command node_modules\.bin\build --win --dir the builder exits with this error:

Skip app dependencies rebuild because dev and app dependencies are not separated
Warning: Application icon is not set, default Electron icon will be used
Packaging for platform win32 x64 using electron 1.3.1 to dist\win-unpacked

Error: Command failed: npm.cmd ls --production --parseable
npm ERR! peer dep missing: react@^0.14.0, required by [email protected]
npm ERR! peer dep missing: react@^0.14.3, required by [email protected]
npm ERR! peer dep missing: react@^0.14.6, required by [email protected]
npm ERR! peer dep missing: react@^0.14.0, required by [email protected]
npm ERR! peer dep missing: react@^0.14.0, required by [email protected]

...

at D:\projects\mail-client\node_modules\electron-builder\src\util\util.ts:98:16
    at ChildProcess.exithandler (child_process.js:209:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
From previous event:
    at Object.exec (D:\projects\mail-client\node_modules\electron-builder\src\util\util.ts:78:9)
    at Object.<anonymous> (D:\projects\mail-client\node_modules\electron-builder\src\util\filter.ts:68:29)
    at next (native)
From previous event:
    at tsAwaiter (D:\projects\mail-client\node_modules\electron-builder\src\util\awaiter.ts:10:47)
    at Object.build (D:\projects\mail-client\node_modules\electron-builder\src\builder.ts:193:52)
    at Object.<anonymous> (D:\projects\mail-client\node_modules\electron-builder\src\build-cli.ts:27:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3

For what I can see it's just npm yelling because some peer deps are not respected but that should not be a problem (with npm 3.x at least), the depencies are correctly installed and the app is running just fine.

@develar
Copy link
Member

develar commented Jul 27, 2016

Before switching to the suggested structure (two package.json)

If you don't use native deps, you can continue to use existing.

Is it possible to attach sample project / link to project?

@ingro
Copy link
Author

ingro commented Jul 27, 2016

Thanks for the answer, since it's a pure-web project native deps should not be needed!

Unfortunately I can't share the project since it's a new product owned by the company where I'm working...

@develar
Copy link
Member

develar commented Jul 27, 2016

Maybe you need to add react to your package.json?

To ensure, execute npm prune — is there some pruned dependency?

@ingro
Copy link
Author

ingro commented Jul 27, 2016

Thanks again for your reply. Some depencies where pruned indeed, but the errors remain. react (v 15.2.1) is present in my package.json file but it's the wrong version for some depenciens that were not update recently and still wants react@^0.14

@ingro
Copy link
Author

ingro commented Jul 27, 2016

I tried to update manually the package.json files of the outdated depencies to set a correct version of react and now the build is successfull!

I understand that this is more an issue of npm rather thant electron-builder itself, anyway there are no other ways around this?

@develar
Copy link
Member

develar commented Jul 27, 2016

@ingro I can investigate, but I need sample project :( (actually, you can send me only package.json)

@ingro
Copy link
Author

ingro commented Jul 27, 2016

I could try to replicate the issue in a smaller repo, I will update here if I manage to do it! Thanks for the help meanwhile!

@ingro
Copy link
Author

ingro commented Jul 27, 2016

@develar here is a simple package.json to replicate the issue:

{
  "name": "peer-bug",
  "version": "1.0.0",
  "description": "Test Client",
  "main": "main.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "[email protected]",
  "license": "MIT",
  "build": {
    "addId": "com.example.client",
    "productName": "TestClient"
  },
  "dependencies": {
    "rc-datepicker": "4.0.0",
    "react": "^15.2.1",
    "react-dom": "^15.2.1"
  },
  "devDependencies": {
    "electron-builder": "^5.17.0",
    "electron-prebuilt": "^1.3.1"
  }
}

@develar
Copy link
Member

develar commented Aug 12, 2016

@ingro Thanks a lot for sample project, fixed.

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

Successfully merging a pull request may close this issue.

2 participants