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

Migration from 1.x - 6.0 errors when project name does not match project root #512

Closed
FrozenPandaz opened this issue May 22, 2018 · 6 comments · Fixed by #692
Closed

Migration from 1.x - 6.0 errors when project name does not match project root #512

FrozenPandaz opened this issue May 22, 2018 · 6 comments · Fixed by #692
Assignees

Comments

@FrozenPandaz
Copy link
Collaborator

FrozenPandaz commented May 22, 2018

Current Behavior

This migration is using the name of the project to locate the files to move.

Expected Behavior

This should use the root of the project

Steps to Reproduce

Repo: https://github.com/merlosy/ngx-material-file-input/tree/ng6

npm i @nrwl/schematics@latest -D
npm run update
@FrozenPandaz
Copy link
Collaborator Author

Trying to get half of the fix for this issue while fixing a related Angular CLI issue: angular/angular-cli#10883

@juristr
Copy link
Member

juristr commented May 30, 2018

Interestingly though, this happened when I did the first attempt to migrate our NX workspace, using one of the NX RC candidates. With the final NX version it didn't happen actually and everything worked (at least related to this particular asset path problem) 🤔

@merlosy
Copy link

merlosy commented Jun 10, 2018

This keeps failing for me with 6.0.3.
I start to think I will have to do it from scratch all over again.
Frustrating...

Here is the full log from npm run update

> [email protected] update /Users/merlosy/sandbox/material-file-input
> nx update

Running 20180507-create-nx-json
Create nx.json before migrating to Angular CLI 6.
-----------------------------------------------------------------------------
Running 20180515-switch-to-nx6
Switch to Nx 6.0

> @angular/[email protected] postinstall /Users/merlosy/sandbox/material-file-input/node_modules/@angular/cli
> node ./bin/ng-update-message.js


================================================================================
The Angular CLI configuration format has been changed, and your existing configuration can
be updated automatically by running the following command:

  ng update @angular/cli
================================================================================

added 15 packages, removed 374 packages, updated 5 packages and moved 33 packages in 32.567s
            Updating karma configuration
            Updating configuration
            Removing old config file (.angular-cli.json)
            Writing config file (angular.json)
            Some configuration options have been changed, please make sure to update any npm scripts which you may have modified.
DELETE .angular-cli.json
CREATE angular.json (11874 bytes)
UPDATE karma.conf.js (1189 bytes)
UPDATE package.json (3068 bytes)
UPDATE tslint.json (2307 bytes)
added 558 packages in 41.687s
ENOENT: no such file or directory, rename 'apps/demo-packaged/e2e' -> 'apps/demo-packaged-e2e/src'
The automatic upgrade to Nx 6 has failed with the following error: Error: Command failed: ng generate @schematics/update:migrate --package @nrwl/schematics --collection @nrwl/schematics/migrations/migrations.json --from 1.0.3 --to 6.0.0.

You can upgrade it manually by running:

* yarn install or npm install
* ng update @angular/[email protected]
* ng update @nrwl/[email protected]

The upgrade process creates a test target for every library. If you have a library
that does not have specs, either set failOnEmptyTestSuite to false in karma.conf.js of the library,
or remove the test target in angular.json.
Migration 20180515-switch-to-nx6 failed
{ Error: Command failed: ng generate @schematics/update:migrate --package @nrwl/schematics --collection @nrwl/schematics/migrations/migrations.json --from 1.0.3 --to 6.0.0
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at Object.run (/Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/migrations/legacy-migrations/20180515-switch-to-nx6.js:34:29)
    at /Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/src/command-line/update.js:87:25
    at Array.forEach (<anonymous>)
    at run (/Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/src/command-line/update.js:83:16)
    at Object.update (/Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/src/command-line/update.js:19:13)
    at Object.handler (/Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/src/command-line/nx.js:33:81)
    at Object.runCommand (/Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/Users/merlosy/sandbox/material-file-input/node_modules/@nrwl/schematics/node_modules/yargs/yargs.js:1014:30)
  error: null,
  cmd: 'ng generate @schematics/update:migrate --package @nrwl/schematics --collection @nrwl/schematics/migrations/migrations.json --from 1.0.3 --to 6.0.0',
  file: '/bin/sh',
  args:
   [ '/bin/sh',
     '-c',
     'ng generate @schematics/update:migrate --package @nrwl/schematics --collection @nrwl/schematics/migrations/migrations.json --from 1.0.3 --to 6.0.0' ],
  options:
   { stdio: [ [Object], [Object], [Object] ],
     shell: true,
     file: '/bin/sh',
     args:
      [ '/bin/sh',
        '-c',
        'ng generate @schematics/update:migrate --package @nrwl/schematics --collection @nrwl/schematics/migrations/migrations.json --from 1.0.3 --to 6.0.0' ],
     envPairs:
      [ 'npm_config_save_dev=',
        'npm_config_legacy_bundling=',
        'npm_config_dry_run=',
        'npm_config_viewer=man',
        'npm_config_only=',
        'npm_config_commit_hooks=true',
        'npm_config_browser=',
        'npm_package_gitHead=53d04ea8753c6cf946f8bd7ef3662372572c5815',
        'npm_package_devDependencies_prettier=1.10.2',
        'npm_config_also=',
        'npm_package_dependencies__ngrx_store_devtools=^5.2.0',
        'npm_package_dependencies__angular_router=5.2.7',
        'npm_package_dependencies__angular_forms=5.2.7',
        'npm_config_rollback=true',
        'npm_package_devDependencies_ng_packagr=^3.0.0-rc.2',
        'npm_package_scripts_workspace_schematic=nx workspace-schematic',
        'TERM_PROGRAM=vscode',
        'NODE=/usr/local/bin/node',
        'npm_config_usage=',
        'npm_package_scripts_build_demo=ng build -a=demo-packaged --prod --base-href /ngx-material-file-input/',
        'INIT_CWD=/Users/merlosy/sandbox/material-file-input',
        'npm_package_devDependencies_typescript=2.6.2',
        'ANDROID_HOME=/Users/merlosy/Library/Android/sdk',
        'npm_config_globalignorefile=/usr/local/etc/npmignore',
        'SHELL=/bin/bash',
        'TERM=xterm-256color',
        'npm_config_shell=/bin/bash',
        'npm_config_maxsockets=50',
        'npm_config_init_author_url=',
        'npm_package_dependencies__angular_platform_browser_dynamic=5.2.7',
        'npm_package_dependencies__angular_cdk=^5.2.5',
        'npm_package_scripts_deploy_demo=npm run commit:demo && npm run push:demo',
        'npm_config_shrinkwrap=true',
        'npm_config_parseable=',
        'npm_config_metrics_registry=https://registry.npmjs.org/',
        'npm_package_devDependencies_tslint=~5.9.1',
        'npm_package_devDependencies__angular_language_service=5.2.7',
        'npm_package_dependencies__angular_animations=5.2.7',
        'TMPDIR=/var/folders/sl/44mz_bkd2bd_prsqc6ns36sw0000gn/T/',
        'npm_config_timing=',
        'npm_config_init_license=ISC',
        'npm_package_scripts_update_skip=nx update:skip',
        'npm_package_scripts_affected_dep_graph=nx affected:dep-graph',
        'npm_package_scripts_lint=nx lint && ng lint',
        'Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.A5ggeqWnhA/Render',
        'npm_config_if_present=',
        'TERM_PROGRAM_VERSION=1.24.0',
        'npm_package_dependencies__ngrx_router_store=^5.2.0',
        'npm_config_sign_git_tag=',
        'npm_config_init_author_email=',
        'npm_config_cache_max=Infinity',
        'npm_config_long=',
        'npm_config_local_address=',
        'npm_config_git_tag_version=true',
        'npm_config_cert=',
        'npm_package_devDependencies__ngrx_schematics=^6.0.1',
        'npm_config_registry=https://registry.npmjs.org/',
        'npm_config_fetch_retries=2',
        'npm_package_devDependencies_karma_jasmine=~1.1.0',
        'npm_package_private=true',
        'npm_package_scripts_test_once=ng test --single-run',
        'npm_config_versions=',
        'npm_config_message=%s',
        'npm_config_key=',
        'npm_package_readmeFilename=README.md',
        'npm_package_description=[![Build Status](https://travis-ci.org/merlosy/ngx-material-file-input.svg?branch=master)](https://travis-ci.org/merlosy/ngx-material-file-input)',
        'npm_package_scripts_affected_apps=nx affected:apps',
        'USER=merlosy',
        'npm_package_license=MIT',
        'npm_package_devDependencies_jasmine_core=~2.8.0',
        'npm_package_scripts_publish_lib=npm publish dist/material-file-input',
        'COMMAND_MODE=unix2003',
        'npm_config_globalconfig=/usr/local/etc/npmrc',
        'npm_package_devDependencies_karma=~2.0.0',
        'npm_package_scripts_dep_graph=nx dep-graph',
        'npm_config_prefer_online=',
        'npm_config_logs_max=10',
        'npm_config_always_auth=',
        'npm_package_devDependencies__types_jasminewd2=~2.0.2',
        'npm_package_scripts_format_check=nx format:check',
        'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.mLlJv3Z1LC/Listeners',
        '__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x1',
        'npm_execpath=/usr/local/lib/node_modules/npm/bin/npm-cli.js',
        'npm_config_global_style=',
        'npm_config_cache_lock_retries=10',
        'npm_package_scripts_e2e=ng e2e',
        'npm_config_cafile=',
        'npm_package_scripts_affected_e2e=nx affected:e2e',
        'npm_package_devDependencies_protractor=~5.1.2',
        'npm_package_scripts_build_lib=ng-packagr -p libs/material-file-input/package.json && cp README.md dist/material-file-input',
        'npm_config_heading=npm',
        'npm_config_searchlimit=20',
        'npm_config_read_only=',
        'npm_config_offline=',
        'npm_config_fetch_retry_mintimeout=10000',
        'npm_package_dependencies_viz=^0.0.1',
        'npm_config_json=',
        'npm_config_access=',
        'npm_config_argv={"remain":[],"cooked":["run","update"],"original":["run","update"]}',
        'npm_package_devDependencies_jasmine_spec_reporter=~4.2.1',
        ... 124 more items ],
     killSignal: undefined },
  envPairs:
   [ 'npm_config_save_dev=',
     'npm_config_legacy_bundling=',
     'npm_config_dry_run=',
     'npm_config_viewer=man',
     'npm_config_only=',
     'npm_config_commit_hooks=true',
     'npm_config_browser=',
     'npm_package_gitHead=53d04ea8753c6cf946f8bd7ef3662372572c5815',
     'npm_package_devDependencies_prettier=1.10.2',
     'npm_config_also=',
     'npm_package_dependencies__ngrx_store_devtools=^5.2.0',
     'npm_package_dependencies__angular_router=5.2.7',
     'npm_package_dependencies__angular_forms=5.2.7',
     'npm_config_rollback=true',
     'npm_package_devDependencies_ng_packagr=^3.0.0-rc.2',
     'npm_package_scripts_workspace_schematic=nx workspace-schematic',
     'TERM_PROGRAM=vscode',
     'NODE=/usr/local/bin/node',
     'npm_config_usage=',
     'npm_package_scripts_build_demo=ng build -a=demo-packaged --prod --base-href /ngx-material-file-input/',
     'INIT_CWD=/Users/merlosy/sandbox/material-file-input',
     'npm_package_devDependencies_typescript=2.6.2',
     'ANDROID_HOME=/Users/merlosy/Library/Android/sdk',
     'npm_config_globalignorefile=/usr/local/etc/npmignore',
     'SHELL=/bin/bash',
     'TERM=xterm-256color',
     'npm_config_shell=/bin/bash',
     'npm_config_maxsockets=50',
     'npm_config_init_author_url=',
     'npm_package_dependencies__angular_platform_browser_dynamic=5.2.7',
     'npm_package_dependencies__angular_cdk=^5.2.5',
     'npm_package_scripts_deploy_demo=npm run commit:demo && npm run push:demo',
     'npm_config_shrinkwrap=true',
     'npm_config_parseable=',
     'npm_config_metrics_registry=https://registry.npmjs.org/',
     'npm_package_devDependencies_tslint=~5.9.1',
     'npm_package_devDependencies__angular_language_service=5.2.7',
     'npm_package_dependencies__angular_animations=5.2.7',
     'TMPDIR=/var/folders/sl/44mz_bkd2bd_prsqc6ns36sw0000gn/T/',
     'npm_config_timing=',
     'npm_config_init_license=ISC',
     'npm_package_scripts_update_skip=nx update:skip',
     'npm_package_scripts_affected_dep_graph=nx affected:dep-graph',
     'npm_package_scripts_lint=nx lint && ng lint',
     'Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.A5ggeqWnhA/Render',
     'npm_config_if_present=',
     'TERM_PROGRAM_VERSION=1.24.0',
     'npm_package_dependencies__ngrx_router_store=^5.2.0',
     'npm_config_sign_git_tag=',
     'npm_config_init_author_email=',
     'npm_config_cache_max=Infinity',
     'npm_config_long=',
     'npm_config_local_address=',
     'npm_config_git_tag_version=true',
     'npm_config_cert=',
     'npm_package_devDependencies__ngrx_schematics=^6.0.1',
     'npm_config_registry=https://registry.npmjs.org/',
     'npm_config_fetch_retries=2',
     'npm_package_devDependencies_karma_jasmine=~1.1.0',
     'npm_package_private=true',
     'npm_package_scripts_test_once=ng test --single-run',
     'npm_config_versions=',
     'npm_config_message=%s',
     'npm_config_key=',
     'npm_package_readmeFilename=README.md',
     'npm_package_description=[![Build Status](https://travis-ci.org/merlosy/ngx-material-file-input.svg?branch=master)](https://travis-ci.org/merlosy/ngx-material-file-input)',
     'npm_package_scripts_affected_apps=nx affected:apps',
     'USER=merlosy',
     'npm_package_license=MIT',
     'npm_package_devDependencies_jasmine_core=~2.8.0',
     'npm_package_scripts_publish_lib=npm publish dist/material-file-input',
     'COMMAND_MODE=unix2003',
     'npm_config_globalconfig=/usr/local/etc/npmrc',
     'npm_package_devDependencies_karma=~2.0.0',
     'npm_package_scripts_dep_graph=nx dep-graph',
     'npm_config_prefer_online=',
     'npm_config_logs_max=10',
     'npm_config_always_auth=',
     'npm_package_devDependencies__types_jasminewd2=~2.0.2',
     'npm_package_scripts_format_check=nx format:check',
     'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.mLlJv3Z1LC/Listeners',
     '__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x1',
     'npm_execpath=/usr/local/lib/node_modules/npm/bin/npm-cli.js',
     'npm_config_global_style=',
     'npm_config_cache_lock_retries=10',
     'npm_package_scripts_e2e=ng e2e',
     'npm_config_cafile=',
     'npm_package_scripts_affected_e2e=nx affected:e2e',
     'npm_package_devDependencies_protractor=~5.1.2',
     'npm_package_scripts_build_lib=ng-packagr -p libs/material-file-input/package.json && cp README.md dist/material-file-input',
     'npm_config_heading=npm',
     'npm_config_searchlimit=20',
     'npm_config_read_only=',
     'npm_config_offline=',
     'npm_config_fetch_retry_mintimeout=10000',
     'npm_package_dependencies_viz=^0.0.1',
     'npm_config_json=',
     'npm_config_access=',
     'npm_config_argv={"remain":[],"cooked":["run","update"],"original":["run","update"]}',
     'npm_package_devDependencies_jasmine_spec_reporter=~4.2.1',
     ... 124 more items ],
  stderr: null,
  stdout: null,
  pid: 2982,
  output: [ null, null, null ],
  signal: null,
  status: 1 }
Please run 'git checkout .'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] update: `nx update`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] update script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/merlosy/.npm/_logs/2018-06-10T17_46_56_598Z-debug.log

@merlosy
Copy link

merlosy commented Jun 10, 2018

Doing it by hand, FWIW I realized there was a mistake in generated angular.json with sourceRoot field, value was src instead of apps/demo/src

From schema.json:

"sourceRoot": {
    "type": "string",
    "description": "The root of the source files, assets and index.html file structure."
 }

@merlosy
Copy link

merlosy commented Jun 10, 2018

It also migrated a lib as "application" instead of " library" in angular.json file

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants