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

serverless-webpack has unmet peer dependency #633

Closed
ZebraFlesh opened this issue Sep 1, 2020 · 4 comments · Fixed by #636
Closed

serverless-webpack has unmet peer dependency #633

ZebraFlesh opened this issue Sep 1, 2020 · 4 comments · Fixed by #636
Labels
Milestone

Comments

@ZebraFlesh
Copy link

This is a Bug Report

Description

After doing an npm install --save-dev serverless-webpack I received a warning about unmet peer dependencies from npm:

npm WARN ts-node@8.10.2 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.

My project doesn't use typescript, so this was unexpected. It seems like ts-node should be an optionalDependency instead of a dependency.

Additional Data

  • Serverless-Webpack Version you're using: 5.3.4
  • Webpack version you're using: 4.44.1
  • Serverless Framework Version you're using: 1.80.0
  • Operating System: macOS 10.15.6 (Catalina)
  • Stack Trace (if available): N/A
@j0k3r
Copy link
Member

j0k3r commented Sep 2, 2020

I agree with you. But as I don't use TypeScript either I don't know how to properly fix it.

Does people using TypeScript always have the ts-node deps? How can we force them to install it? Because the deps is optional for people not using TypeScript but it's required if they use it.

How can we solve that?

Related PR #129

@j0k3r j0k3r added the question label Sep 2, 2020
@ZebraFlesh
Copy link
Author

Based on the instructions from webpack, I'm pretty sure that people using TypeScript for their webpack file will have ts-node installed. That's why optional dependencies seems like the right answer. Looking at the docs for optionalDependencies npm notes:

It is still your program’s responsibility to handle the lack of the dependency.

So perhaps serverless-webpack would need to provide a meaningful error message if the require('ts-node') call failed.

@j0k3r
Copy link
Member

j0k3r commented Sep 2, 2020

Thanks for all these information!

@j0k3r j0k3r added this to the 5.3.5 milestone Sep 3, 2020
@j0k3r
Copy link
Member

j0k3r commented Sep 16, 2020

With 5.3.5 I now have:

warning "serverless-webpack > ts-node@9.0.0" has unmet peer dependency "typescript@>=2.7".

😕
But there is nothing we can do now 🤷

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