After updating Angular from 8.2.4 to 9.1.6 and Typescript from 3.4 to 3.8.3 using
ng update @angular/cli @angular/core
I encountered issues with some module imports that are now breaking. Downgrading to Typescript 3.7 works, but I require 3.8 for a specific package.
The main module import error I'm currently dealing with is:
Module not found: Error: Can't resolve 'zlib' in '<project>/pangeav4/node_modules/request'
An 'npm ls request' reveals that request is included in the dependencies of Angular 9.1.6.
├─┬ @angular-devkit/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f19384989d95dc909f96849d9083b1c1dfc8c1c0dfc7">[email protected]</a>
│ └─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bbd7dec8c8fb88958a8a958a">[email protected]</a>
│ └── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="156770646070666155273b2d2d3b27">[email protected]</a>
├─┬ @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a7976735a23342b342c">[email protected]</a>
│ └─┬ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="22574c4b54475051434e0f434c434e5b564b415162120c160c1012">[email protected]</a>
│ └── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="423027333727313602706c7a7a6c70">[email protected]</a> deduped
Upon inspection of my local node_module/@angular_devkit/build-angular/package.json (v 0.901.6), I noticed that "less" is listed as a dependency.
However, in the package.json file on the github repository for @angular_devkit/build-angular (v 0.901.6), less is not part of the dependencies at all..
How could it be that there's a difference between my local copy and the version on github when they are supposed to be the same?
I attempted deleting package-lock and node_modules and then reinstalling them.
I created a new angular project set to v8 due to the global cli configuration. I believed the issue might stem from a discrepancy between the global and local cli versions (although the ng update process continues and mentions that a temporary build is being used for installation). I updated the global cli to 9, created a new project without the issue, and once again added the dependencies from the existing project causing the problem to resurface. However, removing those dependencies from the package.json, deleting node modules and the lock file, and reinstalling did not resolve the issue in the new project.
Is there another file besides package-lock.json that could be retaining the installation command for the problematic package?
Angular Version Information:
Angular CLI: 9.1.6
Node: 10.18.0
OS: darwin x64
Angular: 9.1.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: No
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.801.3
@angular-devkit/build-angular 0.901.6
@angular-devkit/build-optimizer 0.901.6
@angular-devkit/build-webpack 0.901.6
@angular-devkit/core 9.1.6
@angular-devkit/schematics 9.1.6
@angular/cdk 9.2.4
@angular/cli 9.1.6
@angular/fire 5.4.2
@angular/material 9.2.4
@ngtools/webpack 9.1.6
@schematics/angular 9.1.6
@schematics/update 0.901.6
rxjs 6.5.5
typescript 3.8.3
webpack 4.43.0