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

Error: Cannot find module '@angular/build/package.json' #22

Open
johanndev opened this issue Oct 26, 2024 · 2 comments
Open

Error: Cannot find module '@angular/build/package.json' #22

johanndev opened this issue Oct 26, 2024 · 2 comments

Comments

@johanndev
Copy link
Contributor

I wanted to try the new version via the instructions posted on twitter

System information:

I'm getting the same error on Windows 11 and Ubuntu 23.10. (via WSL). I'm using node 22 on both machines.

Steps to reproduce

  1. npx -y create-nx-workspace@latest acme --preset=apps (No CI or remote caching enabled)
  2. cd acme
  3. npm install -D @ng-rspack/nx @ng-rspack/build --legacy-peer-deps
    This produces the error:
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm error code 1
npm error path /home/<user>/scratch/acme/node_modules/@ng-rspack/build
npm error command failed
npm error command sh -c node ./src/lib/patch/patch-angular-build.js
npm error node:internal/modules/cjs/loader:1252
npm error   throw err;
npm error   ^
npm error
npm error Error: Cannot find module '@angular/build/package.json'
npm error Require stack:
npm error - /home/<user>/scratch/acme/node_modules/@ng-rspack/build/src/lib/patch/patch-angular-build.js
npm error     at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
npm error     at Function.resolve (node:internal/modules/helpers:151:19)
npm error     at main (/home/<user>/scratch/acme/node_modules/@ng-rspack/build/src/lib/patch/patch-angular-build.js:4:43)
npm error     at Object.<anonymous> (/home/<user>/scratch/acme/node_modules/@ng-rspack/build/src/lib/patch/patch-angular-buil
npm error     at Module._compile (node:internal/modules/cjs/loader:1546:14)
npm error     at Object..js (node:internal/modules/cjs/loader:1689:10)
npm error     at Module.load (node:internal/modules/cjs/loader:1318:32)
npm error     at Function._load (node:internal/modules/cjs/loader:1128:12)
npm error     at TracingChannel.traceSync (node:diagnostics_channel:315:14)
npm error     at wrapModuleLoad (node:internal/modules/cjs/loader:218:24) {
npm error   code: 'MODULE_NOT_FOUND',
npm error   requireStack: [
npm error     '/home/<user>/scratch/acme/node_modules/@ng-rspack/build/src/lib/patch/patch-angular-build.js'
npm error   ]
npm error }
npm error
npm error Node.js v22.10.0
npm error A complete log of this run can be found in: /home/<user>/.npm/_logs/2024-10-26T11_37_49_048Z-debug-0.log

The complete debug log can be found here:
2024-10-26T11_37_49_048Z-debug-0.log

@Coly010
Copy link
Owner

Coly010 commented Oct 26, 2024

Interesting 🤔 I’ll need to check the package deps for build. It should have brought @angular/build with it.

I also can’t reproduce this on macOS without —legacy-peer-deps so that could be related

@swalker326
Copy link
Contributor

I've run into this a couple times, rm -rf node_modules and reinstalling seems to resolve it. I have no idea what the source of the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants