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

Error: An old project has been detected, which needs to be updated to Angular CLI 6. #10145

Closed
leon opened this issue Apr 3, 2018 · 4 comments · Fixed by #10162
Closed

Error: An old project has been detected, which needs to be updated to Angular CLI 6. #10145

leon opened this issue Apr 3, 2018 · 4 comments · Fixed by #10162

Comments

@leon
Copy link
Contributor

leon commented Apr 3, 2018

Versions

6.0.0-rc.0
macOS High Sierra

Repro steps

  • yarn global add @angular/cli@next
  • mkdir newemptyfolder
  • cd newemptyfolder
  • ng new ng6

Observed behavior

Creates project but spits out the errors below. and then creates the old project structure.

(node:14722) UnhandledPromiseRejectionWarning: Error: An old project has been detected, which needs to be updated to Angular CLI 6.

Please run the following commands to update this project.

  ng update @angular/cli --migrate-only --from=1.7.1
  npm i
    at WorkspaceLoader._assertUpdatedWorkspace (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/workspace-loader.js:73:19)
    at WorkspaceLoader._getProjectWorkspaceFilePath (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/workspace-loader.js:29:14)
    at WorkspaceLoader.loadWorkspace (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/workspace-loader.js:25:21)
    at NewCommand._loadWorkspace (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/schematic-command.js:255:29)
    at NewCommand.<anonymous> (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/schematic-command.js:53:18)
    at Generator.next (<anonymous>)
    at /Users/leon/.config/yarn/global/node_modules/@angular/cli/models/schematic-command.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/schematic-command.js:3:12)
    at NewCommand.initialize (/Users/leon/.config/yarn/global/node_modules/@angular/cli/models/schematic-command.js:52:16)
(node:14722) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14722) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm WARN deprecated rxjs@6.0.0-smoosh.2: This version is deprecated. Please use the latest version of rxjs.

CREATE ng6/README.md (1025 bytes)
CREATE ng6/angular.json (3806 bytes)
CREATE ng6/package.json (1399 bytes)
CREATE ng6/tsconfig.json (384 bytes)
CREATE ng6/tslint.json (2819 bytes)
CREATE ng6/.editorconfig (245 bytes)
CREATE ng6/.gitignore (503 bytes)
CREATE ng6/src/environments/environment.prod.ts (51 bytes)
CREATE ng6/src/environments/environment.ts (743 bytes)
CREATE ng6/src/favicon.ico (5430 bytes)
CREATE ng6/src/index.html (290 bytes)
CREATE ng6/src/main.ts (370 bytes)
CREATE ng6/src/polyfills.ts (3114 bytes)
CREATE ng6/src/test.ts (642 bytes)
CREATE ng6/src/assets/.gitkeep (0 bytes)
CREATE ng6/src/styles.scss (80 bytes)
CREATE ng6/src/browserslist (51 bytes)
CREATE ng6/src/karma.conf.js (1011 bytes)
CREATE ng6/src/tsconfig.app.json (194 bytes)
CREATE ng6/src/tsconfig.spec.json (282 bytes)
CREATE ng6/src/app/app-routing.module.ts (245 bytes)
CREATE ng6/src/app/app.module.ts (393 bytes)
CREATE ng6/src/app/app.component.scss (0 bytes)
CREATE ng6/src/app/app.component.html (1173 bytes)
CREATE ng6/src/app/app.component.spec.ts (1103 bytes)
CREATE ng6/src/app/app.component.ts (208 bytes)
CREATE ng6/e2e/protractor.conf.js (752 bytes)
CREATE ng6/e2e/src/app.e2e-spec.ts (299 bytes)
CREATE ng6/e2e/src/app.po.ts (208 bytes)
CREATE ng6/e2e/tsconfig.e2e.json (213 bytes)

Desired behavior

Should create new v.6 project structure and not complain about the empty folder being an old project.

Mention any other details that might be useful (optional)

I tried removing all globally installed yarn packages, as to mitigate if any of them where braking cli, but still same problem.
The ng new command was run from a totally empty newly created folder, so it can't be anything to do with that.

@filipesilva
Copy link
Contributor

The project structure is actually right! We had a different multi-project structure that we reverted back to the current one. The key difference is in the angular.json file with different configuration.

We're looking at adding the multi-project first structure as an options in the future for new projects.

The error is not right though. I think we're incorrectly picking up a .angular-cli.json in your home folder or something..

@leon
Copy link
Contributor Author

leon commented Apr 3, 2018

Does it recursively look up the tree until it finds the file, or is there another logic to it?

@filipesilva
Copy link
Contributor

It recursively goes up, looking for either .angular-cli.json or angular-cli.json. If you have one in a folder above, removing it should do it. Might be something else though.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants