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

pnpm 7.19.0 rebuild breaks in Gitlabs CI #5815

Closed
simonauner opened this issue Dec 21, 2022 · 2 comments · Fixed by #5819
Closed

pnpm 7.19.0 rebuild breaks in Gitlabs CI #5815

simonauner opened this issue Dec 21, 2022 · 2 comments · Fixed by #5819
Milestone

Comments

@simonauner
Copy link

simonauner commented Dec 21, 2022

pnpm version:

7.19.0

Code to reproduce the issue:

We run this in our Gitlab CI pipeline.

        - curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
        - pnpm config set store-dir .pnpm-store
        # install dependencies
        - pnpm install --production
        - pnpm rebuild

We need the rebuild because otherwise we cannot execute bin commands in our NPM scripts. This is what happens if we don't run pnpm rebuild:

$ pnpm run build
> cross-env NODE_OPTIONS=--max-old-space-size=4096  WP_ENV=PROD BABEL_ENV=prod webpack --config webpack.config.js
sh: 1: cross-env: Permission denied

Expected behavior:

It should rebuild as normal, everything worked fine for 7.18.2.

Actual behavior:

$ pnpm rebuild
 ERR_INVALID_ARG_TYPE  The "path" argument must be of type string. Received undefined
pnpm [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:120:11)
    at Object.dirname (node:path:1276:5)
    at binDirsInAllParentDirs (/usr/local/pnpm-global/5/node_modules/.pnpm/pnpm@7.19.0/node_modules/pnpm/dist/pnpm.cjs:119203:29)
    at /usr/local/pnpm-global/5/node_modules/.pnpm/pnpm@7.19.0/node_modules/pnpm/dist/pnpm.cjs:119146:35
    at /usr/local/pnpm-global/5/node_modules/.pnpm/pnpm@7.19.0/node_modules/pnpm/dist/pnpm.cjs:52958:38
    at run (/usr/local/pnpm-global/5/node_modules/.pnpm/pnpm@7.19.0/node_modules/pnpm/dist/pnpm.cjs:52958:52)
    at next (/usr/local/pnpm-global/5/node_modules/.pnpm/pnpm@7.19.0/node_modules/pnpm/dist/pnpm.cjs:52953:26)
    at run (/usr/local/pnpm-global/5/node_modules/.pnpm/pnpm@7.19.0/node_modules/pnpm/dist/pnpm.cjs:52964:9)

I assume it's one of our many dependencies that breaks. I will investigate and see if I can pinpoint the culprit.

Additional information:

  • node -v prints: we run image: node:16.14.0
  • Windows, macOS, or Linux?: docker:stable in Gitlab (Linux)

.npmrc:

node-linker=hoisted
// plus some auth-stuff for our internal npm registry
@zkochan
Copy link
Member

zkochan commented Dec 21, 2022

I'll fix this. But I think you can fix it by removing the node_modules directory in your CI. Looks like you cache it.

Also, pnpm rebuild didn't work at all with node linker hoisted and pnpm older than v7.19 (#5560)

@simonauner
Copy link
Author

Ok, thanks!

Funny that it didn't work before, because that's what solved the permission problems for us 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants