nx: Error creating express application

Current Behavior

Error creating a express (v14.1.1) application, sends this: Cannot find module ‘nx/src/generators/utils/json’

Expected Behavior

Create a express application

Steps to Reproduce

yarn add @nrwl/express -W yarn nx g @nrwl/express:application api

Failure Logs

Cannot find module ‘nx/src/generators/utils/json’ Require stack:

  • /home/wmediape/angular/example/node_modules/@nrwl/express/node_modules/@nrwl/devkit/src/generators/format-files.js
  • /home/wmediape/angular/example/node_modules/@nrwl/express/node_modules/@nrwl/devkit/index.js
  • /home/wmediape/angular/example/node_modules/@nrwl/express/src/generators/application/application.js
  • /home/wmediape/angular/example/node_modules/nx/src/config/workspaces.js
  • /home/wmediape/angular/example/node_modules/nx/src/command-line/generate.js
  • /home/wmediape/angular/example/node_modules/nx/src/command-line/nx-commands.js
  • /home/wmediape/angular/example/node_modules/nx/bin/init-local.js
  • /home/wmediape/angular/exmple/node_modules/nx/bin/nx.js error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

I just had this issue after upgrading to: 14.0.1 and it was solved after running these commands (upgrade Nx):

$: nx migrate latest
$: nx migrate --run-migrations

Reference: https://nx.dev/using-nx/updating-nx