angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

An unhandled exception occurred: Cannot find module './getBigInt'

Open arekgotfryd opened this issue 4 years ago β€’ 8 comments

🐞 Bug report

Command (mark with an x)

  • [ ] new
  • [ ] build
  • [ x] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [ ] update
  • [ ] lint
  • [ ] extract-i18n
  • [ ] run
  • [ ] config
  • [ ] help
  • [ ] version
  • [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 11 and 12

Description

When I run ng serve for an app newly created with angular cli I get an error.

πŸ”¬ Minimal Reproduction

  1. ng new geofaker-app
  2. cd geofaker-app
  3. ng serve

πŸ”₯ Exception or Error




Generating browser application bundles (phase: setup)...An unhandled exception occurred: Cannot find module './getBigInt'
Require stack:
- /Users/arek/Development/geofaker-app/node_modules/memfs/lib/Stats.js
- /Users/arek/Development/geofaker-app/node_modules/memfs/lib/index.js
- /Users/arek/Development/geofaker-app/node_modules/webpack-dev-middleware/dist/utils/setupOutputFileSystem.js
- /Users/arek/Development/geofaker-app/node_modules/webpack-dev-middleware/dist/index.js
- /Users/arek/Development/geofaker-app/node_modules/webpack-dev-server/lib/Server.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/build-webpack/src/index.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/build-angular/src/builders/dev-server/index.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/architect/node/index.js
- /Users/arek/Development/geofaker-app/node_modules/@angular/cli/models/architect-command.js
- /Users/arek/Development/geofaker-app/node_modules/@angular/cli/commands/serve-impl.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /Users/arek/Development/geofaker-app/node_modules/@angular-devkit/schematics/tools/index.js
- /Users/arek/Development/geofaker-app/node_modules/@angular/cli/utilities/json-schema.js
- /Users/arek/Development/geofaker-app/node_modules/@angular/cli/models/command-runner.js
- /Users/arek/Development/geofaker-app/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
See "/private/var/folders/gx/n8r6j2c94yqddxsfsjxfwz2h0000gp/T/ng-YnggzR/angular-errors.log" for further details.

🌍 Your Environment




 / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 13.3.5
Node: 16.15.0
Package Manager: npm 8.5.5
OS: darwin x64

Angular: 13.3.8
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.5
@angular-devkit/build-angular   13.3.5
@angular-devkit/core            13.3.5
@angular-devkit/schematics      13.3.5
@angular/cli                    13.3.5
@schematics/angular             13.3.5
rxjs                            7.5.5
typescript                      4.6.4


Anything else relevant?

arekgotfryd avatar May 17 '22 19:05 arekgotfryd

I just downgraded to node v14.19.3 and this seems to work. What is the last version of node which should be fine for @angular/cli?

arekgotfryd avatar May 17 '22 20:05 arekgotfryd

Node version 16 is supported in version 13.

This seems to be an issue in your local environment.

Can you try to re-install node_modules?

If the problem persists can you also try to clean the npm cache using npm cache clean β€”-force?

alan-agius4 avatar May 17 '22 20:05 alan-agius4

Had the same issue... 2 fixes worked for me:

  1. manually install npm package memfs
  2. just nuke everything and ng new again also worked

Depechie avatar May 17 '22 20:05 Depechie

@arekgotfryd looks like memfs just updated their package again. I think getBigInt.js was missing from 3.4.2. I installed 3.4.1 and it worked. Now I see there is a 3.4.3 out there on npmjs...

anwalkers avatar May 17 '22 22:05 anwalkers

Removing the package lock file and re-running a fresh installations should fix this issue.

alan-agius4 avatar May 18 '22 06:05 alan-agius4

when you want to run the app for the first time it needs internet for some pakages and maybe you were offline thats whay it through that exception.

SamiTareen avatar May 18 '22 16:05 SamiTareen

when you want to run the app for the first time it needs internet for some pakages and maybe you were offline thats whay it through that exception.

That’s not correct. Internet is not needed to build or run the application. Internet is needed to download the packages during npm or yarn install.

alan-agius4 avatar May 18 '22 17:05 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.