postmanlabs / postman-code-generators

Common repository for all code generators shipped with Postman
Apache License 2.0
996 stars 351 forks source link

Invalid production flags for pnpm #757

Closed gonzalob closed 2 months ago

gonzalob commented 4 months ago

Postman code generator is using detect-package-manager to determine which one to use. It sends the same production flags to any of them. Even unsupported ones

To reproduce, run a project with pnpm (only) as package manager. https://github.com/postmanlabs/postman-code-generators/pull/744/files sends --no-audit which makes pnpm fail. Having yarn available hides this issue, for instance.

.../node_modules/bigint-buffer install:   c++ -bundle -undefined dynamic_lookup -Wl,-search_paths_first -mmacosx-version-min=10.15 -arch x86_64 -L./Release -stdlib=libc++  -o Release/bigint_buffer.node Release/obj.target/bigint_buffer/src/bigint-buffer.o 
.../node_modules/postman-code-generators postinstall: Failed to run pnpm install on codegen csharp-httpclient, here is the error:
.../node_modules/postman-code-generators postinstall: csharp-restsharp: pnpm install --no-audit --production
.../node_modules/postman-code-generators postinstall: Failed to run pnpm install on codegen csharp-restsharp, here is the error:
.../node_modules/postman-code-generators postinstall: <REDACTED>/node_modules/.pnpm/async@3.2.2/node_modules/async/dist/async.js:324

We patched the library just getting rid of --no-audit in PRODUCTION_FLAG.

opicacek commented 2 months ago

This should be fixed in v1.13.0

https://github.com/postmanlabs/postman-code-generators/pull/765/files#diff-3ebefe3ec53a11217989d1df7bf8ddb4d88e011bd97f05348975626a60615d21R51

cc: @aman-v-singh

gonzalob commented 2 months ago

The sample project works fine with 1.13.0. Thanks!