nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.66k stars 2.36k forks source link

ng update @nrwl/angular fail with: Cannot find module '../run-schematic/executor' #1459

Closed xmlking closed 5 years ago

xmlking commented 5 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Expected Behavior

ng update @nrwl/angular should work

Current Behavior

error: Cannot find module '../run-schematic/executor

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

 ng update
Using package manager: 'yarn'
Collecting installed dependencies...
Found 111 dependencies.
    We analyzed your package.json, there are some packages to update:

      Name                                    Version                  Command to update
     -------------------------------------------------------------------------------------
      @nrwl/angular                           8.0.2 -> 8.1.0           ng update @nrwl/angular
      @nrwl/angular                           8.0.2 -> 8.1.0           ng update @nrwl/angular
      @nrwl/nest                              8.0.2 -> 8.1.0           ng update @nrwl/nest

    There might be additional packages that are outdated.
    Run "ng update --all" to try to update all at the same time.
 ng update @nrwl/angular

Context

Please provide any relevant information about your setup:

A minimal reproduce scenario using allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.

Failure Logs

 ng update @nrwl/angular
Using package manager: 'yarn'
Collecting installed dependencies...
Found 111 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @nrwl/angular @ "8.1.0" (was "8.0.2")...
    Updating package.json with dependency @nrwl/nest @ "8.1.0" (was "8.0.2")...
    Updating package.json with dependency @nrwl/workspace @ "8.1.0" (was "8.0.2")...
UPDATE package.json (7441 bytes)
warning Pattern ["colors@latest"] is trying to unpack in the same destination "/Users/schintha/Library/Caches/Yarn/v4/npm-colors-1.3.3-39e005d546afe01e01f9c4ca8fa50f686a01205d/node_modules/colors" as pattern ["colors@^1.3.3","colors@^1.1.2"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["object-assign@latest"] is trying to unpack in the same destination "/Users/schintha/Library/Caches/Yarn/v4/npm-object-assign-4.1.1-2109adc7965887cfc05cbbd442cac8bfbb360863/node_modules/object-assign" as pattern ["object-assign@^4.1.0","object-assign@^4.1.1","object-assign@^4.0.1","object-assign@^4.1.0","object-assign@^4.1.1","object-assign@^4.0.1","object-assign@^4","object-assign@^4.1.0","object-assign@^4.1.0","object-assign@^4.0.1","object-assign@^4.1.1","object-assign@^4.1.0","object-assign@^4.0.1","object-assign@^4.0.1"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["send@latest"] is trying to unpack in the same destination "/Users/schintha/Library/Caches/Yarn/v4/npm-send-0.17.1-c1d8b059f7900f7466dd4938bdc44e11ddb376c8/node_modules/send" as pattern ["send@0.17.1","send@0.17.1","send@0.17.1"]. This could result in non-deterministic behavior, skipping.
warning " > @ngx-lite/in-viewport@0.1.3" has incorrect peer dependency "@angular/core@^7.0.0".
warning " > @ngx-lite/in-viewport@0.1.3" has incorrect peer dependency "@angular/common@^7.0.0".
warning " > @ngxs-labs/immer-adapter@3.0.3" has incorrect peer dependency "@angular/core@^7.2.0".
warning " > @ngxs/devtools-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/form-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/form-plugin@3.4.3" has incorrect peer dependency "@angular/forms@>=5.0.0 <8.0.0".
warning " > @ngxs/router-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/router-plugin@3.4.3" has incorrect peer dependency "@angular/router@>=5.0.0 <8.0.0".
warning " > @ngxs/storage-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/store@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @xmlking/ngx-knob@0.2.0" has unmet peer dependency "lodash-es@^4.17.11".
warning " > angular-in-memory-web-api@0.8.0" has incorrect peer dependency "@angular/common@>=6.0.0 <8.0.0".
warning " > angular-in-memory-web-api@0.8.0" has incorrect peer dependency "@angular/core@>=6.0.0 <8.0.0".
warning "@nrwl/nest > @nrwl/node > license-webpack-plugin@1.5.0" has unmet peer dependency "webpack-sources@>=1.0.0".
warning " > @ngx-starter-kit/scroll-to-top@0.0.2" has incorrect peer dependency "ngx-page-scroll@>=7.2.0".
warning "workspace-aggregator-16f5df33-f0d7-462a-a85d-481abd96a7c8 > @ngx-starter-kit/api > @nestjs/cqrs@6.0.0" has incorrect peer dependency "reflect-metadata@0.1.12".
Cannot find module '../run-schematic/executor'
Require stack:
- /xyz/SPA/ngx-starter-kit/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tasks/node/index.js
- /xyz/SPA/ngx-starter-kit/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/workflow/node-workflow.js
- /xyz/SPA/ngx-starter-kit/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/index.js
- /xyz/SPA/ngx-starter-kit/node_modules/@angular/cli/utilities/json-schema.js
- /xyz/SPA/ngx-starter-kit/node_modules/@angular/cli/models/command-runner.js
- /xyz/SPA/ngx-starter-kit/node_modules/@angular/cli/lib/cli/index.js
- /Users/xyz/.config/yarn/global/node_modules/@angular/cli/lib/init.js
- /Users/xyz/.config/yarn/global/node_modules/@angular/cli/bin/ng

Other

https://github.com/xmlking/ngx-starter-kit

FrozenPandaz commented 5 years ago

This usually occurs when an older version of @angular/cli is used.

I'm not able to install dependencies in your repo for some reason.

Can you make sure you use the local @angular/cli by using yarn update?

xmlking commented 5 years ago

if you clone the repo, and running yarn in root, should install dependencies. I am using latest @angular/cli also verified i am using latest versions with yarn upgrade-interactive --latest

Angular CLI: 8.0.1
Node: 12.3.1
OS: darwin x64
Angular: 8.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router, service-worker

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.1
@angular-devkit/build-angular      0.800.1
@angular-devkit/build-ng-packagr   0.800.1
@angular-devkit/build-optimizer    0.800.1
@angular-devkit/build-webpack      0.800.1
@angular-devkit/core               8.0.1
@angular-devkit/schematics         8.0.1
@angular/cli                       8.0.1
@angular/flex-layout               8.0.0-beta.26
@angular/pwa                       0.800.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.0.1
@schematics/angular                8.0.1
@schematics/update                 0.800.1
ng-packagr                         5.2.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0
JochenDiekenbrock commented 5 years ago

I get the same error. I upgraded from @nrwl/nx 7.8.6 with yarn update to @nrwl/angular 8.0.0 without problems. When I entered yarn update again, ng update @nrwl/workspace was performed, that resulted in the same error message.

Version Info: yarn ng --version

$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 8.0.1
Node: 10.15.3
OS: linux x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, elements
... forms, language-service, platform-browser
... platform-browser-dynamic, router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.2
@angular-devkit/build-optimizer   0.800.2
@angular-devkit/build-webpack     0.800.2
@angular-devkit/core              8.0.1
@angular-devkit/schematics        8.0.1
@angular/cli                      8.0.1
@ngtools/json-schema              1.1.0
@ngtools/webpack                  8.0.2
@schematics/angular               8.0.1
@schematics/update                0.800.1
ng-packagr                        5.2.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Update: I just noticed, that the following error was displayed while updating from nx 7.8.6 to 8.0.0: Package not installed: "--allow-dirty". Skipping. Might this be related to the problem?

DuncanFaulkner commented 5 years ago

Hi getting a similar error when upgrading to nx v8

Executing migrations for package '@nrwl/schematics' ** Nx has been repackaged. We are installing and migrating your dependencies to the ones necessary. If you have workspace schematics, we tried to migrate your imports from "@nrwl/schematics" to "@nrwl/workspace" but your externalSchematics may be broken.

        Read this guide to see where to find familiar features: https://nx.dev/guides/nx7-to-nx8

        This migration may take a few minutes.
        Removing @nrwl/schematics as a dependency
        Removing @nrwl/builders as a dependency
        Removing @nrwl/nx as a dependency

Cannot parse tslint.json: Unexpected token / in JSON at position 704

brianmcd commented 5 years ago

I'm seeing the same error (Cannot find module '../run-schematic/executor) when trying to yarn update from 8.0.1 -> 8.1.0.

JochenDiekenbrock commented 5 years ago

@xmlking is using Mac OS and my report was from Linux, so I thought it might be a problem that does not occur on Windows. Yesterday, I gave the update a try on Windows. The same error occurs there as well.

JoelBrice commented 5 years ago

I am having a similar problem. cannot find ./render3/view/t2_ap and './render3/view/t2_binder

odahcam commented 5 years ago

On Windows 10 (gitbash CLI), ng 7 (latest) to 8:

USER@MACHINE MINGW64 ~/Projects/vendor/project-name (master)
$ ng update @angular/cli @angular/core
Your global Angular CLI version (8.0.2) is greater than your local
version (7.3.9). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
    Updating package.json with dependency @angular/language-service @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/cli @ "8.0.2" (was "7.3.9")...
    Updating package.json with dependency @angular/compiler-cli @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.800.2" (was "0.10.7")...
    Updating package.json with dependency @angular/animations @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/core @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/common @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/compiler @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/forms @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/platform-browser @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/platform-server @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/service-worker @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency @angular/router @ "8.0.0" (was "7.2.15")...
    Updating package.json with dependency zone.js @ "0.9.1" (was "0.8.29")...
    Updating package.json with dependency typescript @ "3.4.5" (was "3.1.6")...
UPDATE package.json (4263 bytes)
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning @zxing/library > text-encoding@0.7.0: no longer maintained
warning @compodoc/compodoc > live-server > opn@6.0.0: The package has been renamed to `open`
warning @compodoc/compodoc > ts-simple-ast@12.4.0: NOTICE: ts-simple-ast has been renamed to ts-morph and version reset to 1.0.0. Switch at your leisure...
warning karma > log4js > circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
warning sass-lint > eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
warning " > @angular/http@7.2.15" has incorrect peer dependency "@angular/core@7.2.15".
warning " > @angular/http@7.2.15" has incorrect peer dependency "@angular/platform-browser@7.2.15".
warning " > @havan/activity-indicator-overlay@0.0.1" has incorrect peer dependency "@angular/common@^7.1.0".
warning " > @havan/activity-indicator-overlay@0.0.1" has incorrect peer dependency "@angular/core@^7.1.0".
warning " > @nguniversal/common@7.1.1" has incorrect peer dependency "@angular/common@^7.1.4".
warning " > @nguniversal/common@7.1.1" has incorrect peer dependency "@angular/core@^7.1.4".
warning " > @nguniversal/module-map-ngfactory-loader@7.1.1" has incorrect peer dependency "@angular/common@^7.1.4".
warning " > @nguniversal/module-map-ngfactory-loader@7.1.1" has incorrect peer dependency "@angular/core@^7.1.4".
warning " > @nguniversal/module-map-ngfactory-loader@7.1.1" has incorrect peer dependency "@angular/platform-server@^7.1.4".
warning " > @ngxs/devtools-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/logger-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/storage-plugin@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @ngxs/store@3.4.3" has incorrect peer dependency "@angular/core@>=5.0.0 <8.0.0".
warning " > @zxing/ngx-scanner@1.7.1" has incorrect peer dependency "@angular/common@^7.2.0".
warning " > @zxing/ngx-scanner@1.7.1" has incorrect peer dependency "@angular/core@^7.2.0".
warning " > @nguniversal/express-engine@7.1.1" has incorrect peer dependency "@angular/common@^7.1.4".
warning " > @nguniversal/express-engine@7.1.1" has incorrect peer dependency "@angular/core@^7.1.4".
warning " > @nguniversal/express-engine@7.1.1" has incorrect peer dependency "@angular/platform-server@^7.1.4".
Cannot find module '../run-schematic/executor'
odahcam commented 5 years ago

I was able to accomplish the upgrade trought the following steps:

  1. switched from Windows to Ubuntu, cause I have higher OS permissions on Ubuntu.
  2. reverted any changes made after first upgrade try (targeted local dev CLI version is now 7).
  3. deleted node_modules and any yarn file.
  4. switched from yarn to npm on pkg management inside ng CLI, do not delete package-lock.json.
  5. npm i && npm update.
  6. npm run ng update @angular/cli @angular/core so I could use the local Angular CLI, using global is a big mistake as it won't update your code to auto-fix the braking changes.
  7. done
JochenDiekenbrock commented 5 years ago

I tested the upgrade procedure that @odahcam listed above and this worked for me as well. Thanks @odahcam !

mariohmol commented 5 years ago

Works the same here as @odahcam .. shouldnt this be closed?

xmlking commented 5 years ago

Works now. we can close this issue.

github-actions[bot] commented 1 year ago

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.