nrwl/nx

nx postinstall: > NX Failed to parse pnpm lockfile

whydoievenneedthis opened this issue · 2 comments

Current Behavior

When I run pnpm i --frozen-lockfile on github, I encounter the above mentioned error during postinstall. The error does not manifest when I build on my windows based development machine. The error also doesn't seem to be causing any issues, but it did ask me to report it, so here I am.

Expected Behavior

No error during postinstall.

GitHub Repo

https://github.com/whydoievenneedthis/pnpm-install-modules-yaml

Steps to Reproduce

You can just check the action in the repository. The error happens consistently during the Initialize step.

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 18.14.2
   OS   : linux x64
   pnpm : 7.29.1
   
   nx                      : 15.8.6
   @nrwl/js                : 15.8.6
   @nrwl/jest              : 15.8.6
   @nrwl/linter            : 15.8.6
   @nrwl/workspace         : 15.8.6
   @nrwl/angular           : 15.8.6
   @nrwl/cli               : 15.8.6
   @nrwl/cypress           : 15.8.6
   @nrwl/devkit            : 15.8.6
   @nrwl/eslint-plugin-nx  : 15.8.6
   @nrwl/tao               : 15.8.6
   @nrwl/webpack           : 15.8.6
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @ionic/angular        : 6.6.1
   @ngrx/component       : 15.3.0
   @ngrx/component-store : 15.3.0
   @ngrx/effects         : 15.3.0
   @ngrx/entity          : 15.3.0
   @ngrx/router-store    : 15.3.0
   @ngrx/store           : 15.3.0
   @ngrx/schematics      : 15.3.0
   @ngrx/store-devtools  : 15.3.0
   @nxext/capacitor      : 15.7.0
   @nxext/ionic-angular  : 15.7.0
   ngx-build-plus        : 15.0.0

Failure Logs

.../.pnpm/nx@15.8.6/node_modules/nx postinstall$ node ./bin/compute-project-graph
.../esbuild@0.17.8/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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/node_modules/.modules.yaml"
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:    Error: Could not find ".modules.yaml" at "/home/runner/work/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/node_modules/.modules.yaml"
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/home/runner/work/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js:167: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/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js:163:16)
.../.pnpm/nx@15.8.6/node_modules/nx postinstall:     at buildProjectGraphUsingProjectFileMap (/home/runner/work/pnpm-install-modules-yaml/pnpm-install-modules-yaml/frontend/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

Additional Information

The error is complaining about the node_modules/.modules.yaml file. I have exposed that file as a build artifact.

Yeah, that makes sense. We are trying to request .modules.yaml while the installation is ongoing.

Nothing is broken since we do end up with .modules.yaml after the installation, but that error should not be reported.

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.