Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '@angular-devkit/schematics' #5429

Closed
YogliB opened this issue Apr 22, 2021 · 7 comments
Closed

Cannot find module '@angular-devkit/schematics' #5429

YogliB opened this issue Apr 22, 2021 · 7 comments

Comments

@YogliB
Copy link

YogliB commented Apr 22, 2021

Current Behavior

I'm using pnpm with nx and having some trouble generating suing third party generators.
I'm getting an error the some @angular/* dependencies are missing.

It seems that @nrwl/workspace depends on some angular packages that aren't listed in its package.json.

As far as I know, this could be an issue for pnpm because of how it works.

Expected Behavior

No error should happen, and the generator should run.

Steps to Reproduce

npm i -g pnpm@5
pnpx create-nx-workspace --package-manager=pnpm
pnpm add -D @nxext/sveltekit
pnpm nx g @nxext/sveltekit:app

Failure Logs

PS ~\oss\org> pnpm nx g @nxext/sveltekit:app   

> org@0.0.0 nx ~\oss\org
> nx "g" "@nxext/sveltekit:app"      

√ What name would you like to use? · app
Cannot find module '@angular-devkit/schematics'
Require stack:
- ~\oss\org\node_modules\.pnpm\@nrwl\workspace@12.0.8_prettier@2.2.1\node_modules\@nrwl\workspace\src\utils\ast-utils.js   
- ~\oss\org\node_modules\.pnpm\@nrwl\workspace@12.0.8_prettier@2.2.1\node_modules\@nrwl\workspace\src\utils\project-type.js
- ~\oss\org\node_modules\.pnpm\@nrwl\workspace@12.0.8_prettier@2.2.1\node_modules\@nrwl\workspace\index.js
- ~\oss\org\node_modules\.pnpm\@nxext\sveltekit@11.0.0-next.1\node_modules\@nxext\sveltekit\src\generators\application\generator.js 
- ~\oss\org\node_modules\.pnpm\@nrwl\tao@12.0.8\node_modules\@nrwl\tao\src\shared\workspace.js
- ~\oss\org\node_modules\.pnpm\@nrwl\tao@12.0.8\node_modules\@nrwl\tao\src\commands\generate.js
- ~\oss\org\node_modules\.pnpm\@nrwl\tao@12.0.8\node_modules\@nrwl\tao\index.js
- ~\oss\org\node_modules\.pnpm\@nrwl\cli@12.0.8\node_modules\@nrwl\cli\lib\init-local.js
- ~\oss\org\node_modules\.pnpm\@nrwl\cli@12.0.8\node_modules\@nrwl\cli\bin\nx.js
 ERROR  Command failed with exit code 1.

Environment

>  NX  Report complete - copy this into the issue template

  Node : 14.16.1
  OS   : win32 x64
  pnpm : 5.18.9

  nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 12.0.8
  @nrwl/cypress : 12.0.8
  @nrwl/devkit : 12.0.8
  @nrwl/eslint-plugin-nx : 12.0.8
  @nrwl/express : Not Found
  @nrwl/jest : 12.0.8
  @nrwl/linter : 12.0.8
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.0.8
  @nrwl/web : Not Found
  @nrwl/workspace : 12.0.8
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.1.5
@Hotell
Copy link
Contributor

Hotell commented May 28, 2021

The issue is also present for non angular workspaces. We're using only devkit/workspace packages and once we import anything from workspace package it throws reported error.

What's the issue?

@nrwl/workspace still uses internally angular-devkit, (ast-utils file), and because it's not provided 8n package dependencies, consumers are forced to instal angular devkit manually.

Fix:
We need to add angular-devkit to workspace package does

I can send PR if that's ok with you folks @FrozenPandaz @brandonroberts

Cheers

@Hotell
Copy link
Contributor

Hotell commented Jun 28, 2021

created issue for better visibility #6153

@danielrussellLA
Copy link

I am experiencing this same issue

@enchorb
Copy link

enchorb commented Apr 18, 2022

Still get this issue on 13.10.2, have to manually add @angular-devkit/schematics to my devDependencies

@merlosy
Copy link

merlosy commented Jun 23, 2022

Hi, this is still happening in 13.10.5.

The @nrwl/workspace/src/utils/ast-utils.js seems to be the cause of the issue.

@github-actions
Copy link

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
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants