postman-code-generators
postman-code-generators copied to clipboard
Failed to run yarn install on codegen csharp-httpclient
Describe the bug
# This file contains the result of Yarn building a package (postman-code-generators@npm:1.12.0)
# Script name: postinstall
Detected package manager: yarn
Running pre-package script
Run successful languages.js saved in lib/assets
csharp-httpclient: yarn install --no-audit --production
Failed to run yarn install on codegen csharp-httpclient, here is the error:
csharp-restsharp: yarn install --no-audit --production
Failed to run yarn install on codegen csharp-restsharp, here is the error:
./node_modules/postman-code-generators/node_modules/async/dist/async.js:324
if (fn === null) throw new Error("Callback was already called.");
^
Error: Callback was already called.
at ./node_modules/postman-code-generators/node_modules/async/dist/async.js:324:36
at ./node_modules/postman-code-generators/node_modules/async/dist/async.js:3646:17
at ./node_modules/postman-code-generators/npm/deepinstall.js:59:16
at Array.forEach (<anonymous>)
at ./node_modules/postman-code-generators/npm/deepinstall.js:48:14
at ./node_modules/postman-code-generators/node_modules/async/dist/async.js:3641:28
at replenish (./node_modules/postman-code-generators/node_modules/async/dist/async.js:446:21)
at iterateeCallback (./node_modules/postman-code-generators/node_modules/async/dist/async.js:430:21)
at ./node_modules/postman-code-generators/node_modules/async/dist/async.js:327:20
at ./node_modules/postman-code-generators/node_modules/async/dist/async.js:3646:17
Node.js v22.2.0
To Reproduce Steps to reproduce the behavior:
- Create the following
package.jsonfile
{
"name": ".",
"dependencies": {
"postman-code-generators": "^1.12.0"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.0"
}
}
- Run
yarn install
OR
- Run
yarn add [email protected]
Expected code snippet and corresponding request N/A
Screenshots N/A
Additional context N/A
Same with [email protected] for me.
Experiencing the same with Node.js v20.10.0 and [email protected].
Did anyone already have the chance to dig a little deeper and maybe found a workaround/solution to this problem?
1.10.1 is the most recent version not affected by this
Thanks! Using resolutions in the package.json worked for me:
"resolutions": {
"postman-code-generators": "1.10.1"
}
But it might not work for special use cases, as stated here.
Thanks all for reporting this issue! We'er working on fix for this and will inform here once the fix is available.
Thank you everyone for reporting, This issue is now fixed. Please use the latest version v1.13.0.
Still having an issue: my project is using pnpm but I have also yarn in the path so post install script fails with the following error
$ pnpm install
Scope: all 4 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1032
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 0, reused 988, downloaded 0, added 1032, done
node_modules/postman-code-generators: Running postinstall script, failed in 3s
node_modules/postman-code-generators postinstall$ node npm/deepinstall.js
│ Detected package manager: yarn
│ Detected yarn version: 1.22.22
│ Running pre-package script
│ Run successful languages.js saved in lib/assets
│ csharp-httpclient: yarn install --production --frozen-lockfile
│ Failed to run yarn install on codegen csharp-httpclient, here is the error:
│ error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version o…
│ Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool include…
│ Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out htt…
│ csharp-restsharp: yarn install --production --frozen-lockfile
│ Failed to run yarn install on codegen csharp-restsharp, here is the error:
│ C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:324
│ if (fn === null) throw new Error("Callback was already called.");
│ ^
│ Error: Callback was already called.
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:324:36
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:3646:17
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\postman-code-generators\npm\deepinstall.js:…
│ at Array.forEach (<anonymous>)
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\postman-code-generators\npm\deepinstall.js:…
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:3641:28
│ at replenish (C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:446:21)
│ at iterateeCallback (C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:430:2…
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:327:20
│ at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\async\dist\async.js:3646:17
│ Node.js v20.17.0
└─ Failed in 3s at C:\Users\Jeff\work\src\github.com\containers\ai-lab\node_modules\postman-code-generators
ELIFECYCLE Command failed with exit code 1.
See also https://github.com/containers/podman-desktop-extension-ai-lab/pull/1827
Also still experiencing this issue with 1.14.0
- @jeffmaury Check if this issue can be solved by using the
corepack enablecommand in your terminal before installation. This issue is caused by a possible conflict between the environment package manager and the system package manager.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool include… Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out htt…
@MorelSerge, Can you please share more about your issue, such as the error message, package manager, package manager version number, etc.?
@MorelSerge, Can you please share more about your issue, such as the error message, package manager, package manager version number, etc.?
Sure!
I've been running 1.10.0 without issues at the moment. Upgrading to 1.14.0 fails to install due to the error below.
Seem to detect yarn somehow, instead of pnpm?
Package manager = pnpm 9.12.3 Monorepo setup with Turborepo Node 22.1.0
Details
../../node_modules/.pnpm/[email protected]/node_modules/postman-code-generators: Running postinstall scrip../../node_modules/.pnpm/[email protected]/node_modules/postman-code-generators: Running postinstall script, failed in 850ms
.../node_modules/postman-code-generators postinstall$ node npm/deepinstall.js
│ Detected package manager: yarn
│ Detected yarn version: 1.22.21
│ Running pre-package script
│ Run successful languages.js saved in lib/assets
│ csharp-httpclient: yarn install --production --frozen-lockfile
│ Failed to run yarn install on codegen csharp-httpclient, here is the error:
│ error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version…
│ Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool includ…
│ Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out ht…
│ csharp-restsharp: yarn install --production --frozen-lockfile
│ Failed to run yarn install on codegen csharp-restsharp, here is the error:
│ /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js:324
│ if (fn === null) throw new Error("Callback was already called.");
│ ^
│ Error: Callback was already called.
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js:324:36
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js:3646:17
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/postman-cod…
│ at Array.forEach (<anonymous>)
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/postman-cod…
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js:3641:28
│ at replenish (/Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js…
│ at iterateeCallback (/Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/a…
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js:327:20
│ at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/async/dist/async.js:3646:17
│ Node.js v22.1.0
└─ Failed in 850ms at /Users/X/X/X/node_modules/.pnpm/[email protected]/node_modules/postman-code-generators
ELIFECYCLE Command failed with exit code 1.
@MorelSerge, check if this issue can be solved by using the corepack enable command on your terminal before installation.
Hey @jeffmaury @MorelSerge , Are you still having this issue after the suggested resolution?
Hey @jeffmaury @MorelSerge , Are you still having this issue after the suggested resolution?
Apologies for the delay here.
I've run corepack enable and tried reinstalling with pnpm i and the issue is resolved.
Thank you