nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.63k stars 2.36k forks source link

Nx postinstall script fails in Github Actions if repo has nx/playwright #21823

Closed supernaut closed 6 months ago

supernaut commented 9 months ago

Current Behavior

Cannot install package sin Github Actions, so applications can't build or deploy.

Expected Behavior

That pnpm install installs packages and postinstall scripts run without failure.

GitHub Repo

supernaut/nx18-next-playwright

Steps to Reproduce

  1. Add playwright to a Nx 18 repo.
  2. Push to Github with an action installning npm packages.

Nx Report

Node   : 20.11.0
   OS     : darwin-arm64
   pnpm   : 8.15.2

   nx                 : 18.0.4
   @nx/js             : 18.0.4
   @nx/jest           : 18.0.4
   @nx/linter         : 18.0.4
   @nx/eslint         : 18.0.4
   @nx/workspace      : 18.0.4
   @nx/cypress        : 18.0.4
   @nx/devkit         : 18.0.4
   @nx/esbuild        : 18.0.4
   @nx/eslint-plugin  : 18.0.4
   @nx/next           : 18.0.4
   @nx/node           : 18.0.4
   @nx/playwright     : 18.0.4
   @nx/plugin         : 18.0.4
   @nx/react          : 18.0.4
   @nx/storybook      : 18.0.4
   @nrwl/tao          : 18.0.4
   @nx/vite           : 18.0.4
   @nx/web            : 18.0.4
   @nx/webpack        : 18.0.4
   typescript         : 5.3.3
   ---------------------------------------
   Community plugins:
   nx-stylelint : 17.1.4

Failure Logs

.../node_modules/nx postinstall: Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile. 
.../node_modules/nx postinstall:     Inner Error: Error: Could not find ".modules.yaml" at "/home/runner/work/project/project/node_modules/.modules.yaml"
.../node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/utils/pnpm-normalizer.js:23:15)
.../node_modules/nx postinstall:     at getNodes (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:69:77)
.../node_modules/nx postinstall:     at getPnpmLockfileNodes (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:27:12)
.../node_modules/nx postinstall:     at getLockFileNodes (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/lock-file.js:36:59)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/index.js:42:64)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall: Unable to create nodes for apps/next-app/playwright.config.ts using plugin @nx/playwright/plugin. 
.../node_modules/nx postinstall:     Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/next-app'
.../node_modules/nx postinstall:     at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/project/project/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.41.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@typ_3om4g7g466ngcx6j4dyl6hei2y/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall: /home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:156
.../node_modules/nx postinstall:                             throw new CreateNodesError(`Unable to create nodes for ${file} using plugin ${plugin.name}.`, e);
.../node_modules/nx postinstall:                                   ^
.../node_modules/nx postinstall: CreateNodesError: Unable to create nodes for apps/next-app/playwright.config.ts using plugin @nx/playwright/plugin. 
.../node_modules/nx postinstall:     Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/next-app'
.../node_modules/nx postinstall:     at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/project/project/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.41.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@typ_3om4g7g466ngcx6j4dyl6hei2y/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall:     at /home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:156:35
.../node_modules/nx postinstall:     at async Promise.all (index 0) {
.../node_modules/nx postinstall:   [cause]: Error: ENOENT: no such file or directory, scandir 'apps/next-app'
.../node_modules/nx postinstall:       at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:       at exports.createNodes (/home/runner/work/project/project/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.41.2_@swc-node+register@1.8.0_@swc+core@1.3.107_@typ_3om4g7g466ngcx6j4dyl6hei2y/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:       at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:       at createProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:       at _retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:       at retrieveProjectConfigurations (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:       at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/project/project/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69) {
.../node_modules/nx postinstall:     errno: -2,
.../node_modules/nx postinstall:     code: 'ENOENT',
.../node_modules/nx postinstall:     syscall: 'scandir',
.../node_modules/nx postinstall:     path: 'apps/next-app'
.../node_modules/nx postinstall:   }
.../node_modules/nx postinstall: }
.../node_modules/nx postinstall: Node.js v20.11.0
.../node_modules/nx postinstall: Failed
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.

Package Manager Version

pnpm 8.15.1

Operating System

Additional Information

Nx report is run on my local machine, so it's entirely correct. It works locally, but not in Github Actions running on ubuntu-latest. Will set up a repo to reproduce ASAP, but this is a critical showstopper.

supernaut commented 8 months ago

Added repository that reproduces the issue. Direct link to failing run: https://github.com/supernaut/nx18-next-playwright/actions/runs/7917010202/job/21612157572

mhjmaas commented 8 months ago

I am using Gitlab CI and I am seeing the same behaviour. It's quite a major issue for us because the entire point we want to use the plugin is for automatic E2E task splitting in CI environments.

alexkuang0 commented 8 months ago

I seem to encounter the same error, besides that I fail to attribute the error to adding the testing library because I had Playwright bundled in the scaffolding process. Thanks for pointing that out.

garytube commented 8 months ago

same here. we have anagular monorepo (latest version - 1) run

// powershell windows
 >  NX   Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile.

         Inner Error: Error: Could not find ".modules.yaml" at "C:\Users\XXXX\projects\XXXX/node_modules/.modules.yaml"
martialanouman commented 8 months ago

Any progress on this issue?

martialanouman commented 8 months ago

@garytube, do you have any nx version globally installed ? i encountered the same issue and removing the globally installed nx solved it.

garytube commented 8 months ago

I do. Installed with pnpm . Will try . Thx Mate

minuz commented 8 months ago

@garytube, do you have any nx version globally installed ? i encountered the same issue and removing the globally installed nx solved it.

That did not work for me. But removing the @nx/playwright does fix my CI, which kinda confirms this issue. In addition, in my case it only happens in the CI (Azure Pipelines using Ubuntu)

minanmadak commented 8 months ago

I am having this issue on my local but with Cypress.

JoelDigbeu commented 8 months ago

You can try to run pnpm install with --ignore-scripts flag

srslafazan commented 8 months ago

Also encountered this issue with playwright and nx@18.0.4

.../node_modules/nx postinstall: Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile. 
.../node_modules/nx postinstall:     Inner Error: Error: Could not find ".modules.yaml" at "/home/runner/work/advocate-web/advocate-web/node_modules/.modules.yaml"
.../node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/plugins/js/lock-file/utils/pnpm-normalizer.js:23:15)
.../node_modules/nx postinstall:     at getNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:69:77)
.../node_modules/nx postinstall:     at getPnpmLockfileNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:27:12)
.../node_modules/nx postinstall:     at getLockFileNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/plugins/js/lock-file/lock-file.js:36:59)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/plugins/js/index.js:42:64)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall: Unable to create nodes for apps/advocate-applicant-ui/playwright.config.ts using plugin @nx/playwright/plugin. 
.../node_modules/nx postinstall:     Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/advocate-applicant-ui'
.../node_modules/nx postinstall:     at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.36.0_@swc-node+register@1.8.0_@swc+core@1.3.92_@type_ncef556vddipnrzmwhyige6yty/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:[89](https://github.com/ouradvocates/advocate-web/actions/runs/8033191501/job/21943420289#step:6:90):156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall: Unable to create nodes for apps/advocate-platform-ui/playwright.config.ts using plugin @nx/playwright/plugin. 
.../node_modules/nx postinstall:     Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/advocate-platform-ui'
.../node_modules/nx postinstall:     at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.36.0_@swc-node+register@1.8.0_@swc+core@1.3.[92](https://github.com/ouradvocates/advocate-web/actions/runs/8033191501/job/21943420289#step:6:93)_@type_ncef556vddipnrzmwhyige6yty/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall: /home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:156
.../node_modules/nx postinstall:                             throw new CreateNodesError(`Unable to create nodes for ${file} using plugin ${plugin.name}.`, e);
.../node_modules/nx postinstall:                                   ^
.../node_modules/nx postinstall: CreateNodesError: Unable to create nodes for apps/advocate-applicant-ui/playwright.config.ts using plugin @nx/playwright/plugin. 
.../node_modules/nx postinstall:     Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/advocate-applicant-ui'
.../node_modules/nx postinstall:     at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:     at exports.createNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.36.0_@swc-node+register@1.8.0_@swc+core@1.3.92_@type_ncef556vddipnrzmwhyige6yty/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall:     at /home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:156:35
.../node_modules/nx postinstall:     at async Promise.all (index 0) {
.../node_modules/nx postinstall:   [cause]: Error: ENOENT: no such file or directory, scandir 'apps/advocate-applicant-ui'
.../node_modules/nx postinstall:       at readdirSync (node:fs:1515:26)
.../node_modules/nx postinstall:       at exports.createNodes (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/@nx+playwright@18.0.4_@playwright+test@1.36.0_@swc-node+register@1.8.0_@swc+core@1.3.92_@type_ncef556vddipnrzmwhyige6yty/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
.../node_modules/nx postinstall:       at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:       at createProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:       at _retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:       at retrieveProjectConfigurations (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:       at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/advocate-web/advocate-web/node_modules/.pnpm/nx@18.0.4_@swc-node+register@1.8.0_@swc+core@1.3.92/node_modules/nx/src/project-graph/project-graph.js:71:69) {
.../node_modules/nx postinstall:     errno: -2,
.../node_modules/nx postinstall:     code: 'ENOENT',
.../node_modules/nx postinstall:     syscall: 'scandir',
.../node_modules/nx postinstall:     path: 'apps/advocate-applicant-ui'
.../node_modules/nx postinstall:   }
.../node_modules/nx postinstall: }
.../node_modules/nx postinstall: Node.js v20.11.1
.../node_modules/nx postinstall: Failed
 ELIFECYCLE  Command failed with exit code 1.
martialanouman commented 8 months ago

@garytube, do you have any nx version globally installed ? i encountered the same issue and removing the globally installed nx solved it.

That did not work for me. But removing the @nx/playwright does fix my CI, which kinda confirms this issue. In addition, in my case it only happens in the CI (Azure Pipelines using Ubuntu)

My suggestion was about the .modules.yaml issue. We still experience issue in CI with @nx/playwright. Currently only @JoelDigbeu workaround helped to solve it.

supernaut commented 8 months ago

Nx 18.0.5 seems to have fixed the issue in our production repository, but not in my test repo strangely enough. https://github.com/supernaut/nx18-next-playwright/actions/runs/8037651724/job/21952716499

srslafazan commented 8 months ago

I can confirm as well, 18.0.5 fixes that particular issue for us.

qstyler commented 8 months ago

I'm on 18.0.5 and I still get the same error:

.../node_modules/nx postinstall$ node ./bin/post-install
.../node_modules/nx postinstall: Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile. 
.../node_modules/nx postinstall:     Inner Error: Error: Could not find ".modules.yaml" at "/home/vmadmin/agent/_work/11/s/node_modules/.modules.yaml"
.../node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/utils/pnpm-normalizer.js:23:15)
.../node_modules/nx postinstall:     at getNodes (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:69:77)
.../node_modules/nx postinstall:     at getPnpmLockfileNodes (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:27:12)
.../node_modules/nx postinstall:     at getLockFileNodes (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/lock-file/lock-file.js:36:59)
.../node_modules/nx postinstall:     at exports.createNodes (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/plugins/js/index.js:42:64)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/vmadmin/agent/_work/11/s/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
.../node_modules/nx postinstall: Unable to create nodes for apps/client/jest.config.ts using plugin @nx/jest/plugin. 
.../node_modules/nx postinstall:     Inner Error: Error: ● Validation Error:
.../node_modules/nx postinstall:   Module @nrwl/jest/plugins/resolver in the resolver option was not found.
.../node_modules/nx postinstall:          <rootDir> is: /home/vmadmin/agent/_work/11/s/apps/client
.../node_modules/nx postinstall:   Configuration Documentation:
.../node_modules/nx postinstall:   https://jestjs.io/docs/configuration
martialanouman commented 8 months ago

The 18.0.5 update fixes the issue with playwright, but now i got another issue with @nx/webpack in CI only.

Whenever i try to build any of the apps in the monorepo i got Unable to create nodes for apps/gateway/webpack.config.js using plugin @nx/webpack/plugin error. Even when the app is not concerned when running nx affected command.

I got 2 remix apps and 2 nestjs apps. Only the NestJs apps (and thier deps) are using @nx/webpack executor

Unable to create nodes for apps/gateway/webpack.config.js using plugin @nx/webpack/plugin. 
     Inner Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (node:internal/validators:162:11)
    at Object.join (node:path:1175:7)
    at createLoaderFromCompiler (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/compiler-loaders.js:49:58)
    at applyNxDependentConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:313:61)
    at applyBaseConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:35:5)
    at configure (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/with-nx.js:15:49)
    at combined (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/config.js:[23](https://github.com/Arolitec/tara/actions/runs/8054185580/job/21998237728#step:9:25):28)
    at async readWebpackOptions (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/webpack/read-webpack-options.js:17:18)
    at async createWebpackTargets (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:61:28)
    at async exports.createNodes (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:47:15)
Unable to create nodes for apps/gateway-sp-extractor/webpack.config.js using plugin @nx/webpack/plugin. 
     Inner Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (node:internal/validators:162:11)
    at Object.join (node:path:1175:7)
    at createLoaderFromCompiler (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/compiler-loaders.js:49:58)
    at applyNxDependentConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:313:61)
    at applyBaseConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:35:5)
    at configure (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/with-nx.js:15:49)
    at combined (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/config.js:23:28)
    at async readWebpackOptions (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/webpack/read-webpack-options.js:17:18)
    at async createWebpackTargets (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:61:28)
    at async exports.createNodes (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:47:15)
CreateNodesError: Unable to create nodes for apps/gateway/webpack.config.js using plugin @nx/webpack/plugin. 
     Inner Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (node:internal/validators:162:11)
    at Object.join (node:path:1175:7)
    at createLoaderFromCompiler (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/compiler-loaders.js:49:58)
    at applyNxDependentConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:313:61)
    at applyBaseConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:35:5)
    at configure (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/with-nx.js:15:49)
    at combined (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/config.js:23:28)
    at async readWebpackOptions (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/webpack/read-webpack-options.js:17:18)
    at async createWebpackTargets (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:61:28)
    at async exports.createNodes (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:47:15)
    at /home/runner/work/tara/tara/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:156:35
    at async Promise.all (index 0)
    at async Promise.all (index 5)
    at async createProjectConfigurations (/home/runner/work/tara/tara/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:62)
    at async buildProjectGraphAndSourceMapsWithoutDaemon (/home/runner/work/tara/tara/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
    at async createProjectGraphAndSourceMapsAsync (/home/runner/work/tara/tara/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:136:[25](https://github.com/Arolitec/tara/actions/runs/8054185580/job/21998237728#step:9:27))
    at async createProjectGraphAsync (/home/runner/work/tara/tara/node_modules/.pnpm/nx@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:125:39)
    at async createWatchPaths (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+remix@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_nx@18.0.5_typescript@5.3.3/node_modules/@nx/remix/src/utils/create-watch-paths.js:14:19)
    at async resolveConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@remix-run+dev@2.7.2_@remix-run+serve@2.7.2_@types+node@18.16.9_less@4.1.3_stylus@0.59.0_ts-n_cwju67q2dvmbowy7ztffsxqfoq/node_modules/@remix-run/dev/dist/config.js:183:23)
    at async Object.readConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@remix-run+dev@2.7.2_@remix-run+serve@2.7.2_@types+node@18.16.9_less@4.1.3_stylus@0.59.0_ts-n_cwju67q2dvmbowy7ztffsxqfoq/node_modules/@remix-run/dev/dist/config.js:72:10) {
  [cause]: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
      at validateString (node:internal/validators:162:11)
      at Object.join (node:path:1175:7)
      at createLoaderFromCompiler (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/compiler-loaders.js:49:58)
      at applyNxDependentConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:313:61)
      at applyBaseConfig (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:35:5)
      at configure (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/with-nx.js:15:49)
      at combined (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/config.js:23:[28](https://github.com/Arolitec/tara/actions/runs/8054185580/job/21998237728#step:9:30))
      at async readWebpackOptions (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/utils/webpack/read-webpack-options.js:17:18)
      at async createWebpackTargets (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:61:28)
      at async exports.createNodes (/home/runner/work/tara/tara/node_modules/.pnpm/@nx+webpack@18.0.5_@swc-node+register@1.8.0_@swc+core@1.3.107_@types+node@18.16.9_esbuild@0.1_p2f4fos7t5dvafdbzbtv5ftz2i/node_modules/@nx/webpack/src/plugins/plugin.js:[47](https://github.com/Arolitec/tara/actions/runs/8054185580/job/21998237728#step:9:49):15) {
    code: 'ERR_INVALID_ARG_TYPE'
  }
}
garytube commented 8 months ago

I updated to 18.0.5 but the install still breaks

// azure pipeline
...
node_modules/nx postinstall$ node ./bin/post-install
.../builder/node_modules/nx postinstall$ node ./bin/post-install
.../builder/node_modules/nx postinstall: Done
node_modules/nx postinstall: Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile. 
node_modules/nx postinstall:     Inner Error: Error: Could not find ".modules.yaml" at "D:\a\1\s/node_modules/.modules.yaml"
node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (D:\a\1\s\node_modules\nx\src\plugins\js\lock-file\utils\pnpm-normalizer.js:23:15)
node_modules/nx postinstall:     at getNodes (D:\a\1\s\node_modules\nx\src\plugins\js\lock-file\pnpm-parser.js:69:77)
node_modules/nx postinstall:     at getPnpmLockfileNodes (D:\a\1\s\node_modules\nx\src\plugins\js\lock-file\pnpm-parser.js:27:12)
node_modules/nx postinstall:     at getLockFileNodes (D:\a\1\s\node_modules\nx\src\plugins\js\lock-file\lock-file.js:36:59)
node_modules/nx postinstall:     at exports.createNodes (D:\a\1\s\node_modules\nx\src\plugins\js\index.js:42:64)
node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (D:\a\1\s\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:148:29)
node_modules/nx postinstall:     at createProjectConfigurations (D:\a\1\s\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:89:156)
node_modules/nx postinstall:     at _retrieveProjectConfigurations (D:\a\1\s\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:61:12)
node_modules/nx postinstall:     at retrieveProjectConfigurations (D:\a\1\s\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:46:12)
node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (D:\a\1\s\node_modules\nx\src\project-graph\project-graph.js:71:69)
node_modules/nx postinstall: Done

Done in 2m 29.9s
Finishing: pnpm install and build dev Mode
johnkingzy commented 8 months ago

I was having this same error Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile. among other errors similar to @srslafazan errors above, even after upgrading to nx@18.0.5.

I was able to get pass the error using --ignore-scripts with pnpm install as suggested by @JoelDigbeu . I still believe this is a workaround since it just ignores running the pre-install and post-install scripts.

- name: Install dependencies
   run: pnpm install --ignore-scripts
ebalo55 commented 8 months ago

I got the same error, trying to drop node_modules and pnpm-lock.yaml on the local machine resulted in the presence of the error on my local machine too. A temporary fix seems to be touching the node_modules/.modules.yaml file before running the installation of any packages. An example follows

mkdir node_modules -p && touch node_modules/.modules.yaml
pnpm install --frozen-lockfile

Notice that at least in my case this fix was not enough as the plugin seems not to find my playwright configuration.

ebalo55 commented 8 months ago

I got the same error, trying to drop node_modules and pnpm-lock.yaml on the local machine resulted in the presence of the error on my local machine too. A temporary fix seems to be touching the node_modules/.modules.yaml file before running the installation of any packages. An example follows

mkdir node_modules -p && touch node_modules/.modules.yaml
pnpm install --frozen-lockfile

Notice that at least in my case this fix was not enough as the plugin seems not to find my playwright configuration.

EDIT:

After a few trial and errors my fully workaround solution with playwright (to run both on local system and CI) is as follows:

# Workaround step 1: Create the missing yaml file 
mkdir node_modules -p && touch node_modules/.modules.yaml

# Install your dependencies how you prefer, notice that the --ignore-scripts is required 
# to complete the installation successfully
pnpm install --frozen-lockfile --ignore-scripts

# Workaround step 2: Install missing 3rdy party binaries like playwright's
pnpm exec playwright install-deps
pnpm exec playwright install
supernaut commented 8 months ago

Updated my reproduction repository to Nx 18.0.6, still no dice.

https://github.com/supernaut/nx18-next-playwright/actions/runs/8112372498/job/22173466571

v-karbovnichy commented 8 months ago

I have the same issue in Vercel deployment running nx 18.0.8 but without playwright in my repo (installed cypress but still not used it). Localy it passes through this step normally

../node_modules/nx postinstall: Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile. 
.../node_modules/nx postinstall:     Inner Error: Error: Could not find ".modules.yaml" at "/vercel/path0/node_modules/.modules.yaml"
.../node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/plugins/js/lock-file/utils/pnpm-normalizer.js:23:15)
.../node_modules/nx postinstall:     at getNodes (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:69:77)
.../node_modules/nx postinstall:     at getPnpmLockfileNodes (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:27:12)
.../node_modules/nx postinstall:     at getLockFileNodes (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/plugins/js/lock-file/lock-file.js:36:59)
.../node_modules/nx postinstall:     at exports.createNodes (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/plugins/js/index.js:42:64)
.../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
.../node_modules/nx postinstall:     at createProjectConfigurations (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
.../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
.../node_modules/nx postinstall:     at retrieveProjectConfigurations (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
.../node_modules/nx postinstall:     at async buildProjectGraphAndSourceMapsWithoutDaemon (/vercel/path0/node_modules/.pnpm/nx@18.0.8_@swc-node+register@1.8.0_@swc+core@1.3.100/node_modules/nx/src/project-graph/project-graph.js:71:69)
ciekawy commented 7 months ago

same here for angular/webpack.

khludenevav commented 7 months ago

Same on pnpm i on buildkite on


.../node_modules/nx postinstall$ node ./bin/post-install
--
  | .../node_modules/nx postinstall: Unable to create nodes for pnpm-lock.yaml using plugin nx/js/dependencies-and-lockfile.
  | .../node_modules/nx postinstall:     Inner Error: Error: Could not find ".modules.yaml" at "/home/buildkite/root/client/node_modules/.modules.yaml"
  | .../node_modules/nx postinstall:     at loadPnpmHoistedDepsDefinition (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/plugins/js/lock-file/utils/pnpm-normalizer.js:23:15)
  | .../node_modules/nx postinstall:     at getNodes (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:69:77)
  | .../node_modules/nx postinstall:     at getPnpmLockfileNodes (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/plugins/js/lock-file/pnpm-parser.js:27:12)
  | .../node_modules/nx postinstall:     at getLockFileNodes (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/plugins/js/lock-file/lock-file.js:36:59)
  | .../node_modules/nx postinstall:     at exports.createNodes (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/plugins/js/index.js:42:64)
  | .../node_modules/nx postinstall:     at buildProjectsConfigurationsFromProjectPathsAndPlugins (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:146:25)
  | .../node_modules/nx postinstall:     at createProjectConfigurations (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
  | .../node_modules/nx postinstall:     at _retrieveProjectConfigurations (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
  | .../node_modules/nx postinstall:     at retrieveProjectConfigurations (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
  | .../node_modules/nx postinstall:     at buildProjectGraphAndSourceMapsWithoutDaemon (/home/buildkite/root/client/node_modules/.pnpm/nx@18.1.2_@swc-node+register@1.8.0_@swc+core@1.3.96/node_modules/nx/src/project-graph/project-graph.js:73:69)
  | .../node_modules/nx postinstall: Done
 NX   Report complete - copy this into the issue template

Node   : 20.10.0
OS     : darwin-arm64
pnpm   : 8.15.5

nx (global)        : 18.1.2
nx                 : 18.1.2
@nx/js             : 18.1.2
@nx/jest           : 18.1.2
@nx/eslint         : 18.1.2
@nx/workspace      : 18.1.2
@nx/devkit         : 18.1.2
@nx/eslint-plugin  : 18.1.2
@nx/next           : 18.1.2
@nx/plugin         : 18.1.2
@nx/react          : 18.1.2
@nx/storybook      : 18.1.2
@nx/web            : 18.1.2
typescript         : 5.3.3
---------------------------------------
Local workspace plugins:
         nx-plugin
cyrus-za commented 6 months ago

Same here on nx 18.0.8 in github actions, but not locally and only after I added a react UI component lib, so did not touch nx or @nx/playwright at all. Very strange

Ant1N commented 6 months ago

Same issue here without having @nx/playwright in the repo at all. The only recent change is the addition of Storybook.

This is in a react-native monorepo.

leosvelperez commented 6 months ago

hey @supernaut and all!

The issue seems to have been fixed in Nx 18.2.0. @supernaut I sent a PR to your repo (https://github.com/supernaut/nx18-next-playwright/pull/3), but it's awaiting approval to run the workflow. I ran the action on my fork, and it ran successfully using that version of Nx: https://github.com/leosvelperez/nx-21823-issue/actions/runs/9062566452/job/24896710147#step:5:21.

I'm going to close this since it has been addressed.

If after updating to, at least, Nx 18.2.0, you still see the Could not find ".modules.yaml" at "/home/runner/work/project/project/node_modules/.modules.yaml" error when installing packages, please leave a message, and we'll take a look. If the error is something else, please check if it has already been reported or file a new issue.

github-actions[bot] commented 5 months ago

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.