DiffEqOnline icon indicating copy to clipboard operation
DiffEqOnline copied to clipboard

ng serve failing. Seems like dependency management issue

Open milesfrain opened this issue 5 years ago • 4 comments

I'm having trouble building this project, even when attempting to match the older Angular version. Could someone run through the build steps on their machine and confirm they still work today?

Here are my steps for reference:

npm install -g [email protected]
npm install
ng serve

This results in a Cannot find module '@angular/compiler-cli/ngcc' error, and a bunch of UNMET PEER DEPENDENCY warnings under npm list -g -depth 0

I put together a more detailed log of troubleshooting steps below:

Starting conditions:

Global packages:

Nothing other than npm installed.

miles@x1c5 ~/p/j/d/DiffEqOnline> npm list -g -depth 0
/home/miles/.nvm/versions/node/v11.10.1/lib
└── [email protected]

Local packages:

Nothing installed. Unmet dependencies expected.

miles@x1c5 ~/p/j/d/DiffEqOnline> npm list -depth 0
[email protected] /home/miles/projects/julia/deq_demo/DiffEqOnline
├── UNMET DEPENDENCY @angular/common@~2.1.0
...
└── UNMET DEPENDENCY zone.js@^0.6.23

After installing angular-cli:

npm install -g [email protected]

Peer dependency warnings in build log:

npm WARN @ngtools/[email protected] requires a peer of @angular/compiler-cli@^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/[email protected] requires a peer of typescript@>=3.4 < 3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @ngtools/[email protected] requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@1 || 2 || 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.

Global packages.

angular-cli added. Lots of missing peer dependency warnings. I assume I need to manually install all of these. Will attempt that after the npm install step.

miles@x1c5 ~/p/j/d/DiffEqOnline> npm list -g -depth 0
/home/miles/.nvm/versions/node/v11.10.1/lib
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: @angular/compiler-cli@^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9, required by @ngtools/[email protected]
npm ERR! peer dep missing: typescript@>=3.4 < 3.6, required by @ngtools/[email protected]
npm ERR! peer dep missing: webpack@^4.0.0, required by @ngtools/[email protected]
npm ERR! peer dep missing: webpack@^2.0.0 || ^3.0.0 || ^4.0.0, required by [email protected]
npm ERR! peer dep missing: webpack@1 || 2 || 3, required by [email protected]
npm ERR! peer dep missing: webpack@^1.0.0 || ^2.0.0 || ^3.0.0, required by [email protected]
npm ERR! peer dep missing: webpack@^1.0.0 || ^2.0.0 || ^3.0.0, required by [email protected]

Local packages:

Listing is unchanged, as expected. (log omitted for brevity).

After installing local dependencies:

npm install This adds some of the missing local package dependencies, but there are lots of unmet peer dependencies.

Local packages:

miles@x1c5 ~/p/j/d/DiffEqOnline> npm list --depth=0
[email protected] /home/miles/projects/julia/deq_demo/DiffEqOnline
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── @angular/[email protected]
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── UNMET PEER DEPENDENCY @angular/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── UNMET PEER DEPENDENCY @webcomponents/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: @angular/common@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/compiler@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/core@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/forms@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/platform-browser@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/platform-browser-dynamic@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/router@^3.2.0, required by [email protected]
npm ERR! peer dep missing: @webcomponents/[email protected], required by [email protected]
npm ERR! peer dep missing: typescript@>=3.4 < 3.6, required by @ngtools/[email protected]
npm ERR! peer dep missing: @angular/common@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/compiler@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/compiler-cli@^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9, required by @ngtools/[email protected]
npm ERR! peer dep missing: @angular/core@^2.2.0, required by [email protected]
npm ERR! peer dep missing: @angular/platform-browser@^2.2.0, required by [email protected]
npm ERR! peer dep missing: typescript@>=3.4 < 3.6, required by @ngtools/[email protected]
npm ERR! peer dep missing: webpack@^4.0.0, required by @ngtools/[email protected]
npm ERR! peer dep missing: webpack@^2.0.0 || ^3.0.0 || ^4.0.0, required by [email protected]
npm ERR! peer dep missing: webpack@1 || 2 || 3, required by [email protected]
npm ERR! peer dep missing: webpack@^1.0.0 || ^2.0.0 || ^3.0.0, required by [email protected]
npm ERR! peer dep missing: webpack@^1.0.0 || ^2.0.0 || ^3.0.0, required by [email protected]

Global packages:

Listing is unchanged, as expected. (log omitted for brevity).

Attempting to install an unmet peer dependency

Let's look at one of the first dependency errors in our local listing: UNMET PEER DEPENDENCY @angular/[email protected] and npm ERR! peer dep missing: @angular/common@^2.2.0, required by [email protected]

I'm interpreting this as @angular/[email protected] is currently installed, but we need to bump this to 2.2.0 to satisfy clarity-angular requirements.

I see the following lines in package.json "@angular/common": "^2.1.2", "clarity-angular": "^0.7.5-dev",

Installing required version with: npm install @angular/[email protected] This updated package.json too.

Now the local listing shows this pair of errors: UNMET PEER DEPENDENCY @angular/[email protected] npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]

So there's a mismatch where: @angular/[email protected] is required by @angular/[email protected] but @angular/common@^2.2.0 is required by [email protected]

I'm assuming it's safer to bump the minor version of @angular/forms and friends to 2.2.0.

Another conflict is @webcomponents/[email protected], required by [email protected] where @webcomponents/[email protected] is installed. Probably not good to revert custom-elements, but the next version of clarity-icons is a major version bump, so seems like things may break either way. It also seems impossible to update clarity-icons to a point where it's compatible with [email protected], since the latest version (as of today) only goes up to 1.1.0 https://github.com/vmware/clarity/blob/9749d669943adf7e53d71b84ec0eaee8a3bc7137/package.json#L92 I'm wondering if I can just ignore this unmet peer dependency.

Here's a diff of what seems to have cut down on most peer dependency issues

miles@x1c5 ~/p/j/d/DiffEqOnline> git diff
diff --git a/package.json b/package.json
index 29fb31e..71708a2 100644
--- a/package.json
+++ b/package.json
@@ -13,14 +13,14 @@
   },
   "private": true,
   "dependencies": {
-    "@angular/common": "~2.1.0",
-    "@angular/compiler": "~2.1.0",
-    "@angular/core": "~2.1.0",
-    "@angular/forms": "~2.1.0",
-    "@angular/http": "~2.1.0",
-    "@angular/platform-browser": "~2.1.0",
-    "@angular/platform-browser-dynamic": "~2.1.0",
-    "@angular/router": "~3.1.0",
+    "@angular/common": "^2.2.4",
+    "@angular/compiler": "~2.2.0",
+    "@angular/core": "~2.2.0",
+    "@angular/forms": "~2.2.0",
+    "@angular/http": "~2.2.0",
+    "@angular/platform-browser": "~2.2.0",
+    "@angular/platform-browser-dynamic": "~2.2.0",
+    "@angular/router": "^3.2.4",
     "@webcomponents/custom-elements": "^1.0.0-alpha.3",
     "clarity-angular": "^0.7.5-dev",
     "clarity-icons": "^0.7.5-dev",

But a bunch still remain:

miles@x1c5 ~/p/j/d/DiffEqOnline> npm list --depth=0
[email protected] /home/miles/projects/julia/deq_demo/DiffEqOnline
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── UNMET PEER DEPENDENCY @webcomponents/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
└── [email protected]

npm ERR! peer dep missing: @webcomponents/[email protected], required by [email protected]
npm ERR! peer dep missing: typescript@>=3.4 < 3.6, required by @ngtools/[email protected]
npm ERR! peer dep missing: @angular/compiler-cli@^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9, required by @ngtools/[email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: @angular/[email protected], required by @angular/[email protected]
npm ERR! peer dep missing: typescript@>=3.4 < 3.6, required by @ngtools/[email protected]
npm ERR! peer dep missing: webpack@^4.0.0, required by @ngtools/[email protected]
npm ERR! peer dep missing: webpack@^2.0.0 || ^3.0.0 || ^4.0.0, required by [email protected]
npm ERR! peer dep missing: webpack@1 || 2 || 3, required by [email protected]
npm ERR! peer dep missing: webpack@^1.0.0 || ^2.0.0 || ^3.0.0, required by [email protected]
npm ERR! peer dep missing: webpack@^1.0.0 || ^2.0.0 || ^3.0.0, required by [email protected]

Attempting ng serve at this point still results in a Cannot find module '@angular/compiler-cli/ngcc' error.

milesfrain avatar Aug 09 '19 20:08 milesfrain

Also considered attempting to upgrade the app from angular2 to angular8, but I don't have much confidence in this succeeding. https://update.angular.io/#2.0:8.0

milesfrain avatar Aug 09 '19 20:08 milesfrain

Yes, this library is setup for Angular2 and Julia 0.5. It needs an update

ChrisRackauckas avatar Aug 10 '19 01:08 ChrisRackauckas

The front-end used a very early version of Angular 2+, but fortunately its very simple -- I can rewrite it in current Angular. @ChrisRackauckas I remember we were waiting on something to update the backend to Julia 1.x -- is that possible now or are we still blocked?

amellnik avatar Aug 19 '19 15:08 amellnik

It was the compilation setup. I think we can do that now just by using FunctionWrappers.

ChrisRackauckas avatar Aug 21 '19 12:08 ChrisRackauckas