Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NX @nrwl/node generator error "Cannot find module 'nx/src/utils/code-frames"

I am attempting to generate a new node project using @nrwl/node and when I use the generator I am met with the error

 NX   Cannot find module 'nx/src/utils/code-frames'

inhibiting me from running the generator.

my nx version is 15.2.1 my @nrwl/node version is 15.9.2 and my node version is 16.17.0

Ive attempted to reinstall the packages multiple times to no avail.

like image 478
Miqhtie Avatar asked Sep 04 '26 15:09

Miqhtie


2 Answers

nx and @nrwl/node must be at the same version. You should see an error if you run nx workspace-lint (prior to its deprecation), or during nx report on newer versions.

nx migrate latest would get things synced back up.

like image 53
Craigory Coppola Avatar answered Sep 07 '26 20:09

Craigory Coppola


Run nx report

You will get results like the following:

NX Some packages have misaligned versions! These packages should match your installed version of Nx.

  • @nrwl/[email protected]
  • @nrwl/[email protected]
  • @nrwl/[email protected]
  • @nrwl/[email protected]
  • @nrwl/[email protected] You should be able to fix this by running nx migrate 15.9.3

Running nx migrate 15.9.3

Then Yarn or NPM i

The conflict will be solved

like image 33
Yaser Ananbeh Avatar answered Sep 07 '26 21:09

Yaser Ananbeh