nx-extensions
nx-extensions copied to clipboard
Angular: Cannot find module
Describe the bug Cannot create angular app.
D:\dev\web\apps\my-app>nx g @nxext/angular:application
> NX Generating @nxext/angular:application
√ What name would you like to use for the application? · web-client
√ Which stylesheet format would you like to use? · css
√ Would you like to configure routing for this application? (y/N) · true
> NX Cannot find module 'nx/src/utils/app-root'
Require stack:
- D:\dev\web\apps\my-app\node_modules\@nxext\vite\node_modules\@nrwl\devkit\index.js
- D:\dev\web\apps\my-app\node_modules\@nxext\vite\src\generators\init\init.js
- D:\dev\web\apps\my-app\node_modules\@nxext\vite\src\index.js
- D:\dev\web\apps\my-app\node_modules\@nxext\angular\src\generators\init\init.js
- D:\dev\web\apps\my-app\node_modules\@nxext\angular\src\generators\application\application.js
- D:\dev\web\apps\my-app\node_modules\nx\src\config\workspaces.js
- D:\dev\web\apps\my-app\node_modules\nx\src\command-line\generate.js
- D:\dev\web\apps\my-app\node_modules\nx\src\command-line\nx-commands.js
- D:\dev\web\apps\my-app\node_modules\nx\bin\init-local.js
- D:\dev\web\apps\my-app\node_modules\nx\bin\nx.js
Pass --verbose to see the stacktrace.
To Reproduce
-
npx create-nx-workspace my-app --preset=empty
-
npm install @nxext/angular
-
nx g @nxext/angular:application
-
my-app
-
css
-
true
-
Expected behavior Created angular app.
Additional context
> NX Report complete - copy this into the issue template
Node : 16.14.0
OS : win32 x64
yarn : 1.22.18
nx : 14.4.1
@nrwl/angular : 13.3.12
@nrwl/cypress : 13.3.12
@nrwl/devkit : 13.3.12
@nrwl/jest : 13.3.12
@nrwl/linter : 13.3.12
@nrwl/nx-cloud : 14.2.0
@nrwl/storybook : 13.3.12
@nrwl/workspace : 14.4.1
typescript : 4.7.4
---------------------------------------
Community plugins:
@nxext/angular: 13.0.0-alpha.2
Same error with attempting to generate an Angular library, using WSL2 under win32
(and, confirmed no 'app-root' exists under node_modules/nx/src/utils
)
Node : 16.16.0
OS : linux x64
npm : 8.11.0
nx : 14.5.1
@nrwl/angular : 14.5.1
@nrwl/cypress : 14.5.1
@nrwl/detox : Not Found
@nrwl/devkit : 14.5.1
@nrwl/eslint-plugin-nx : 14.5.1
@nrwl/express : Not Found
@nrwl/jest : 14.5.1
@nrwl/js : 14.5.1
@nrwl/linter : 14.5.1
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.5.1
@nrwl/web : 14.5.1
@nrwl/workspace : 14.5.1
typescript : 4.7.4
---------------------------------------
Community plugins:
@nxext/angular: 13.0.0-alpha.2
why is it coming today only, it was working for me till yesterday (for me its for @nxext/stencil)
I think the problem is version mismatch. You need to have nx
and all @nrwl/*
packages installed with the same version.