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

[YARN] Can not install @bryntum product packages using yarn v2/v3 #5719

Closed
SergeyMaltsev opened this issue Dec 6, 2022 · 13 comments
Closed
Assignees
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer resolved Fixed but not yet released (available in the nightly builds) yarn
Milestone

Comments

@SergeyMaltsev
Copy link
Contributor

SergeyMaltsev commented Dec 6, 2022

Forum post

Yarn v.2

yarn add @bryntum/scheduler@npm:@bryntum/scheduler-trial@5.2.4
➤ YN0000: ┌ Resolution step
➤ YN0001: │ TypeError: @bryntum/scheduler-trial-lib@npm:1.0.0: Invalid Version: latest

Everything is ok when I install @bryntum/scheduler-angular. The package is installed successfully.

System info:

yarn --version 2.4.3
node --version v16.15.0

Yarn v.3

"YN0001: │ Error: @bryntum/calendar@npm:@bryntum/calendar-trial isn't supported by any available resolver"

Related forum post

@SergeyMaltsev SergeyMaltsev added bug Something isn't working forum Issues from forum large-account Reported by large customer yarn labels Dec 6, 2022
@SergeyMaltsev SergeyMaltsev self-assigned this Dec 6, 2022
@SergeyMaltsev SergeyMaltsev changed the title [YARN] Can not install scheduler-trial using yarn v.2 [YARN] Can not install scheduler-trial using yarn v.2/v.3 Feb 17, 2023
@danielpza
Copy link

Changing the postinstall scripts seems to work:

// package.json:
   "scripts": {
-    "postinstall": "node ../gantt-lib/build.js"
+    "postinstall": "node postinstall.js"
   },
// postinstall.js
require("@bryntum/gantt-lib/build.js")

@SergeyMaltsev
Copy link
Contributor Author

@danielpza
Thanks for sharing this info. We will check if that helps with yarn package manager.
Seems that Yarn creates temporary folder structure during installing packages, which differs from existing in regular npm package manager, so is can not reach ../gantt-lib/build.js

@SergeyMaltsev SergeyMaltsev changed the title [YARN] Can not install scheduler-trial using yarn v.2/v.3 [YARN] Can not install @bryntum product packages using yarn v2/v3 Sep 20, 2023
@danielpza
Copy link

To clarify, the issue is with Yarn PnP. It works fine with yarn node modules linker on v2/v3:

yarn config set nodeLinker node-modules

@danielpza
Copy link

Thanks @SergeyMaltsev, looking forward for a fix :-)

@SergeyMaltsev
Copy link
Contributor Author

@danielpza so if someone configures yarn with that nodeLinker setting it could be a workaround for the installation bug without changing our packages?

@danielpza
Copy link

Yarn PnP is the default strategy but can be disabled. Yes it is a workaround for using it with yarn v2...
Still yarn PnP has some advantages hopefully bryntum can support it

@danielpza
Copy link

For more information about the different install modes with yarn v2 see https://yarnpkg.com/features/linkers

@SergeyMaltsev
Copy link
Contributor Author

@danielpza
Thanks for your feedback!
Yes, we will check your proposal for fixing packages.
We need this solution to work with regular npm PM also.

@lassesteffen
Copy link

lassesteffen commented Oct 31, 2023

That would be super cool! Are there any workarounds for pnp?

@SergeyMaltsev
Copy link
Contributor Author

@lassesteffen does it have same problems as in yarn?
Could you please provide some more information?

@lassesteffen
Copy link

Using yarn4, it's giving this error using pnp

# This file contains the result of Yarn building a package (@bryntum/schedulerpro@npm:5.3.5)
# Script name: postinstall


node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^
Error: Qualified path resolution failed: we looked for the following paths, but none could be accessed.

Source path: /Users/lassesteffen/projects/koppla/koppla-webapp/.yarn/unplugged/@bryntum-schedulerpro-npm-5.3.5-331f73d781/node_modules/@bryntum/schedulerpro-lib/build.js
Not found: /Users/lassesteffen/projects/koppla/koppla-webapp/.yarn/unplugged/@bryntum-schedulerpro-npm-5.3.5-331f73d781/node_modules/@bryntum/schedulerpro-lib/build.js

    at makeError (/Users/lassesteffen/projects/koppla/koppla-webapp/.pnp.cjs:37338:34)
    at resolveUnqualified (/Users/lassesteffen/projects/koppla/koppla-webapp/.pnp.cjs:39102:13)
    at resolveRequest (/Users/lassesteffen/projects/koppla/koppla-webapp/.pnp.cjs:39142:14)
    at Object.resolveRequest (/Users/lassesteffen/projects/koppla/koppla-webapp/.pnp.cjs:39198:26)
    at resolve$1 (file:///Users/lassesteffen/projects/koppla/koppla-webapp/.pnp.loader.mjs:1997:21)
    at nextResolve (node:internal/modules/esm/hooks:833:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:278:30)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)

Node.js v20.9.0

Checking the path, the file also doesn't exist.

@SergeyMaltsev
Copy link
Contributor Author

@lassesteffen
Thank you for the information.
We have ready development build which works for yarn install or yarn add commands.
We plan to release it in coming patch release for 5.6.x

@SergeyMaltsev SergeyMaltsev added resolved Fixed but not yet released (available in the nightly builds) and removed in progress labels Nov 7, 2023
@SergeyMaltsev SergeyMaltsev added this to the 5.6.1 milestone Nov 7, 2023
@SergeyMaltsev
Copy link
Contributor Author

We have released 5.6.1 with support for yarn. Please try it and share your results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer resolved Fixed but not yet released (available in the nightly builds) yarn
Projects
None yet
Development

No branches or pull requests

3 participants