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

Daemon Giving an Error message nx postinstall step when used with pnpm #15656

Closed
ZackDeRose opened this issue Mar 14, 2023 · 2 comments · Fixed by #15660
Closed

Daemon Giving an Error message nx postinstall step when used with pnpm #15656

ZackDeRose opened this issue Mar 14, 2023 · 2 comments · Fixed by #15660

Comments

@ZackDeRose
Copy link
Member

Current Behavior

We're seeing Nx in the Tanstack/query project (uses pnpm as it's package manager) that the Nx Daemon is failing inside of ci in the nx postinstall step, due to being unable to parse the pnpm lockfile.

See comment: TanStack/query#5116 (comment)

Expected Behavior

I'm not familiar enough with Nx Daemon's interactions with pnpm or it's lockfiles, but it would seem that we should be able to handle the lack of the lockfile better - and this may be simply an issue with the error message we're giving? I'll look to discuss more with y'all tomorrow!

GitHub Repo

No response

Steps to Reproduce

See "Install dependencies" step of https://github.com/TanStack/query/actions/runs/4413801983/jobs/7734712705

Nx Report

n/a

Failure Logs

Run pnpm --filter "./packages/**" --filter query --prefer-offline install
  pnpm --filter "./packages/**" --filter query --prefer-offline install
  shell: /usr/bin/bash -e {0}
  env:
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
    NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
    NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX
Scope: 14 of 50 workspace projects
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
.                                        |    +1103 ++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/runner/setup-pnpm/node_modules/.bin/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 1103, reused 0, downloaded 22, added 16
Progress: resolved 1103, reused 0, downloaded 96, added 91
Progress: resolved 1103, reused 0, downloaded 210, added 202
Progress: resolved 1103, reused 0, downloaded 318, added 317
Progress: resolved 1103, reused 0, downloaded 418, added 419
Progress: resolved 1103, reused 0, downloaded 525, added 530
Progress: resolved 1103, reused 0, downloaded 672, added 669
Progress: resolved 1103, reused 0, downloaded 775, added 780
Progress: resolved 1103, reused 0, downloaded 855, added 857
Progress: resolved 1103, reused 0, downloaded 918, added 920
Progress: resolved 1103, reused 0, downloaded 982, added 990
Progress: resolved 1103, reused 0, downloaded 1029, added 1033
Progress: resolved 1103, reused 0, downloaded 1063, added 1069
Progress: resolved 1103, reused 0, downloaded 1079, added 1087
Progress: resolved 1103, reused 0, downloaded 1091, added 1100
Progress: resolved 1103, reused 0, downloaded 1092, added 1101
Progress: resolved 1103, reused 0, downloaded 1094, added 1103, done
.../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}"
.../node_modules/@parcel/watcher install$ node-gyp-build
.../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
.../node_modules/microtime install$ node-gyp-build
.../node_modules/core-js-pure postinstall: Done
.../node_modules/svelte-preprocess postinstall$ echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc..."
.../node_modules/@parcel/watcher install: Done
.../node_modules/svelte-preprocess postinstall: [svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc...
.../node_modules/svelte-preprocess postinstall: Done
.../node_modules/vue-demi postinstall: Done
.../node_modules/microtime install: Done
.../esbuild@0.16.15/node_modules/esbuild postinstall$ node install.js
.../esbuild@0.15.9/node_modules/esbuild postinstall$ node install.js
.../esbuild@0.14.54/node_modules/esbuild postinstall$ node install.js
.../.pnpm/nx@15.8.6/node_modules/nx postinstall$ node ./bin/compute-project-graph
.../esbuild@0.16.15/node_modules/esbuild postinstall: Done
.../esbuild@0.15.9/node_modules/esbuild postinstall: Done
.../esbuild@0.14.54/node_modules/esbuild postinstall: Done
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:  >  NX   Daemon Server - Stopped
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:  >  NX   Failed to parse pnpm lockfile
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:    Please open an issue at `https://github.com/nrwl/nx/issues/new?template=1-bug.yml` and provide a reproduction.
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:    
.../.pnpm/nx@15.8.6/node_modules/nx postinstall: Original error: Could not find ".modules.yaml" at "/home/runner/work/query/query/node_modules/.modules.yaml"
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:    Error: Could not find ".modules.yaml" at "/home/runner/work/query/query/node_modules/.modules.yaml"
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/home/runner/work/query/query/node_modules/.pnpm/nx@15.8.6/node_modules/nx/src/lock-file/utils/pnpm-normalizer.js:36:15)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at addNodes (/home/runner/work/query/query/node_modules/.pnpm/nx@15.8.6/node_modules/nx/src/lock-file/pnpm-parser.js:51:77)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at parsePnpmLockfile (/home/runner/work/query/query/node_modules/.pnpm/nx@15.8.6/node_modules/nx/src/lock-file/pnpm-parser.js:14:5)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at parseLockFile (/home/runner/work/query/query/node_modules/.pnpm/nx@15.8.6/node_modules/nx/src/lock-file/lock-file.js:74:56)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at /home/runner/work/query/query/node_modules/.pnpm/nx@15.8.6/node_modules/nx/src/project-graph/build-project-graph.js:63:62
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at Generator.next (<anonymous>)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at /home/runner/work/query/query/node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.js:118:75
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at new Promise (<anonymous>)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at Object.__awaiter (/home/runner/work/query/query/node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.js:114:16)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at buildProjectGraphUsingProjectFileMap (/home/runner/work/query/query/node_modules/.pnpm/nx@15.8.6/node_modules/nx/src/project-graph/build-project-graph.js:36:20)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall: Done
. preinstall$ node -e "if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}" || npx -y only-allow pnpm
. preinstall: Skipping preinstall...
. preinstall: Done
Done in 26.4s


### Additional Information

_No response_
@meeroslav
Copy link
Contributor

This is a duplicate of #15642.

The nx postinstall is starting the graph creation which then triggers the pnpm lock file parsing.
The parsing expects the .modules.yaml to exist but that file is not yet there since the installation has not finished yet.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants