nx icon indicating copy to clipboard operation
nx copied to clipboard

Set Up Application Proxies Fail - NX Cannot find module 'nx/src/plugins/package-json-workspaces'

Open Leo-Wangyc opened this issue 1 year ago โ€ข 2 comments

Documentation issue

  • [ ] Reporting a typo
  • [x] Reporting a documentation bug
  • [ ] Documentation improvement
  • [x] Documentation feedback

Is there a specific documentation page you are reporting?

Enter the URL or documentation section here.

Additional context or description

I started a new react + next project and chose the nest.js as the backend service. Then I try to connect them through setting up application proxies. Here are the commands in the docs:

nx g @nx/node:app <node-app> --frontendProject my-react-app
nx g @nx/nest:app <nest-app> --frontendProject my-react-app
nx g @nx/express:app <express-app> --frontendProject my-react-app

I ran 'nx g @nx/nest:app --frontendProject my-react-app' this command. But it throw an error

NX Cannot find module 'nx/src/plugins/package-json-workspaces'

I'm not sure which step I did is wrong. Thanks. Node version is v21.1.0.

image

Leo-Wangyc avatar Feb 02 '24 08:02 Leo-Wangyc

By the way, Node version is v21.1.0. Thanks!

Leo-Wangyc avatar Feb 03 '24 07:02 Leo-Wangyc

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

github-actions[bot] avatar Feb 18 '24 00:02 github-actions[bot]

I have this error too. In start, react-native metro server

richguma avatar Feb 19 '24 02:02 richguma

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

github-actions[bot] avatar Mar 05 '24 00:03 github-actions[bot]

Well this is frustrating. I am getting this same error and have no clue what to do about it.

using npx nx g @nx/node:application <app name> --dry-run

aholthagerty avatar Mar 07 '24 17:03 aholthagerty

Was able to fix it locally for me by editing node_modules/@nx/jest/src/plugins/plugin.js line 12 to be:

const package_json_workspaces_1 = require("nx/plugins/package-json-workspaces");

definitely a hacky solution, though.

it appears @nx/jest is looking in the wrong directory for package-json-workspaces since it does not appear to be located at nx/src/plugins but instead at just nx/plugins

aholthagerty avatar Mar 07 '24 17:03 aholthagerty

Still happening

airowe avatar Mar 13 '24 19:03 airowe

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

github-actions[bot] avatar Mar 28 '24 00:03 github-actions[bot]

going to comment here to keep this issue from auto-closing.

aholthagerty avatar Apr 01 '24 13:04 aholthagerty

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

github-actions[bot] avatar Apr 16 '24 00:04 github-actions[bot]

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[bot] avatar May 31 '24 00:05 github-actions[bot]