feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.08k stars 752 forks source link

Dependency issue with MongoDB when using "npm create" #3046

Closed splurgebudget closed 1 year ago

splurgebudget commented 1 year ago

Steps to reproduce

Tried with both 16 (v16.19.0) 17 (v17.9.1) 18 (v18.7.0 and v18.14.0) and 19 (19.6.0)

npm create feathers@pre whatever
? Do you want to use JavaScript or TypeScript? JavaScript
? Write a short description Stuff
? Which HTTP framework do you want to use? KoaJS (recommended)
? What APIs do you want to offer? HTTP (REST), Real-time
? Which package manager are you using? npm
? What is your preferred schema (model) definition format? JSON schema
? Which database are you connecting to? Other databases can be added at any time MongoDB
? Enter your database connection string mongodb://127.0.0.1:27017/feathers_splurge
? Which authentication methods do you want to use? Other methods and providers can be added at any time. Email + Password

It throws up nom errors - but also acts like everything is fine:

......
    Running npm install --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: feathers_splurge@0.0.0
npm ERR! Found: mongodb@5.0.1
npm ERR! node_modules/mongodb
npm ERR!   mongodb@"5.0.1" from the root project
npm ERR!   peer mongodb@">=3.4.0" from mongodb-client-encryption@2.5.0
npm ERR!   node_modules/mongodb-client-encryption
npm ERR!     peerOptional mongodb-client-encryption@"^2.3.0" from mongodb@5.0.1
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer mongodb@"^4.5.0" from @feathersjs/mongodb@5.0.0-pre.36
npm ERR! node_modules/@feathersjs/mongodb
npm ERR!   @feathersjs/mongodb@"^5.0.0-pre.36" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/friedmud/.npm/_logs/2023-02-09T05_44_08_281Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/friedmud/.npm/_logs/2023-02-09T05_44_08_281Z-debug-0.log
Error: undefined

Hooray! Your Feathers app is ready to go! 🚀
Go to the feathers_splurge folder to get started.

To learn more visit https://dove.feathersjs.com/guides

Expected behavior

A new, fully functioning, app is created.

Actual behavior

Some packages don't get installed - OR - the installation errors out

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):

NodeJS version: 16 (v16.19.0) 17 (v17.9.1) 18 (v18.7.0 and v18.14.0) and 19 (19.6.0)

Operating System: Ubuntu 22.10

splurgebudget commented 1 year ago

It "works" if Yarn is selected instead of npm... but still gives these warnings:

warning " > @feathersjs/mongodb@5.0.0-pre.36" has incorrect peer dependency "mongodb@^4.5.0".
warning "@feathersjs/cli > @feathersjs/generators > @feathershq/pinion > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
daffl commented 1 year ago

Thank you for digging into this. This has now been fixed via https://github.com/feathersjs/feathers/pull/3041 and published in 5.0.0-pre.37.

splurgebudget commented 1 year ago