GithubHelp home page GithubHelp logo

Comments (9)

madorb avatar madorb commented on June 11, 2024 1

Ah, thank you! not being a node developer - i was fully unaware of overrides, but that seems to have done the trick.

I've opened an MR to try to get acceptDependencies documented npm/registry#24 so that other vendors can ensure their products return it in abbreviated metadata. Appreciate your help

from generator.

mshima avatar mshima commented on June 11, 2024

@yeoman/types have acceptDependencies.
https://github.com/yeoman/yeoman-api/blob/af49cc9f1c276ecb0b8ee334a8570c9596221da2/workspaces/types/package.json#L60

Maybe you should update yeoman-test and yeoman-environment together.

from generator.

madorb avatar madorb commented on June 11, 2024

@yeoman/types have acceptDependencies. https://github.com/yeoman/yeoman-api/blob/af49cc9f1c276ecb0b8ee334a8570c9596221da2/workspaces/types/package.json#L60

Maybe you should update yeoman-test and yeoman-environment together.

I'm likely missing something - but it's not clear to me how yeoman-test or yeoman-environment are related to the issue? I don't have either in my package.json nor do they show up in the error output.

I saw that @yeoman/types had acceptDependencies but it certainly doesn't seem to be working as intended. I wonder if it's because 4.0.0-beta.1 isn't valid semver?

In case it's useful, here is my dependencies section from package.json:

  "dependencies": {
    "semver": "^7.5.2",
    "update-notifier": "^6.0.2",
    "yeoman-generator": "^7.1.0",
    "yosay": "^3.0.0",
    "chalk": "^5.3.0",
    "mem-fs": "^4.0.0",
  },

from generator.

mshima avatar mshima commented on June 11, 2024

I’ve created a new folder and run npm install yeoman-generator, no conflicts there using npm@latest.
You should try to remove node_modules, package-lock, and update npm.

from generator.

madorb avatar madorb commented on June 11, 2024

I get errors on completely new projects using various different configurations. I've asked other folks on my team to try this out as well and they get same error.

Node 18:

❯ node --version
v18.18.0
❯ npm --version
9.8.1
❯ mkdir yeoman-test
❯ cd yeoman-test
❯ npm install yeoman-generator
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/mem-fs
npm ERR!   peerOptional mem-fs@"^3.0.0" from @yeoman/[email protected]
npm ERR!   node_modules/@yeoman/types
npm ERR!     peer @yeoman/types@"^1.1.1" from [email protected]
npm ERR!     node_modules/yeoman-generator
npm ERR!       yeoman-generator@"*" from the root project
npm ERR!   mem-fs@"^3.0.0" from [email protected]
npm ERR!   node_modules/mem-fs-editor
npm ERR!     peerOptional mem-fs-editor@"^10.0.2" from @yeoman/[email protected]
npm ERR!     node_modules/@yeoman/types
npm ERR!       peer @yeoman/types@"^1.1.1" from [email protected]
npm ERR!       node_modules/yeoman-generator
npm ERR!         yeoman-generator@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mem-fs@"^4.0.0" from [email protected]
npm ERR! node_modules/yeoman-generator
npm ERR!   yeoman-generator@"*" 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.

Node 20 w/ out-of-the-box npm version from nodenv:

❯ node --version
v20.9.0
❯ npm --version
10.1.0
❯ mkdir yeoman-test-n20
❯ cd yeoman-test-n20
❯ npm install yeoman-generator
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/mem-fs
npm ERR!   peerOptional mem-fs@"^3.0.0" from @yeoman/[email protected]
npm ERR!   node_modules/@yeoman/types
npm ERR!     peer @yeoman/types@"^1.1.1" from [email protected]
npm ERR!     node_modules/yeoman-generator
npm ERR!       yeoman-generator@"*" from the root project
npm ERR!   mem-fs@"^3.0.0" from [email protected]
npm ERR!   node_modules/mem-fs-editor
npm ERR!     peerOptional mem-fs-editor@"^10.0.2" from @yeoman/[email protected]
npm ERR!     node_modules/@yeoman/types
npm ERR!       peer @yeoman/types@"^1.1.1" from [email protected]
npm ERR!       node_modules/yeoman-generator
npm ERR!         yeoman-generator@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mem-fs@"^4.0.0" from [email protected]
npm ERR! node_modules/yeoman-generator
npm ERR!   yeoman-generator@"*" 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.

Node 20 with latest npm

❯ node --version
v20.9.0
❯ npm --version
10.2.3
❯ mkdir yeoman-test-n20-npm-102
❯ cd yeoman-test-n20-npm-102
❯ npm install yeoman-generator
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/mem-fs
npm ERR!   peerOptional mem-fs@"^3.0.0" from @yeoman/[email protected]
npm ERR!   node_modules/@yeoman/types
npm ERR!     peer @yeoman/types@"^1.1.1" from [email protected]
npm ERR!     node_modules/yeoman-generator
npm ERR!       yeoman-generator@"*" from the root project
npm ERR!   mem-fs@"^3.0.0" from [email protected]
npm ERR!   node_modules/mem-fs-editor
npm ERR!     peerOptional mem-fs-editor@"^10.0.2" from @yeoman/[email protected]
npm ERR!     node_modules/@yeoman/types
npm ERR!       peer @yeoman/types@"^1.1.1" from [email protected]
npm ERR!       node_modules/yeoman-generator
npm ERR!         yeoman-generator@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mem-fs@"^4.0.0" from [email protected]
npm ERR! node_modules/yeoman-generator
npm ERR!   yeoman-generator@"*" 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.

from generator.

madorb avatar madorb commented on June 11, 2024

well. turns out it looks like it's something in our environment / internal repo because:

npm install yeoman-generator --registry=https://registry.npmjs.com/

works fine.

sorry for the confusion.

from generator.

madorb avatar madorb commented on June 11, 2024

Well. It is on our side... but we're definitely not the only folks who are gonna run into this.

acceptedDependencies is not defined as being returned on the abbreviated metadata object, and as such it's not returned by our artifactory instance when installing. It appears that npm repo though does return it.

If i hack my local npm's arborist/build-ideal-tree.js to request the full metadata from artifactory it works properly.

https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object

It seems to me like acceptedDependencies should be considered unusable until it's part of the documented metadata "spec" so that non-npm repositories know they should be implementing it?

from generator.

mshima avatar mshima commented on June 11, 2024

Thanks for the follow up.

Unfortunately moving the dependency to dependencies instead of acceptDependencies would be a breaking change since mem-fs@4 would be installed by default and it requires node 18 while types requires node 16.
Maybe there would be others side effects to the types.

You can try to use overrides to workaround the problem.

from generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.