6.0.0-rc.7 Regression: Cannot find package.json when running ng update
See original GitHub issueI’ve got a project I want to update to Angular v6. First step was to move update the CLI from 1.7.4
to 6.0.0-rc.7
. Found that didn’t work.
Note that this error does not come up if you update to the previous 6.0.0-rc.6
version.
Versions
Started with this before changing my package.json
to 6.0.0-rc.7
Angular CLI: 1.7.4
Node: 8.9.4
OS: darwin x64
Angular: 5.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router
@angular/cdk: 5.2.4
@angular/cli: 1.7.4
@angular/material: 5.2.4
@angular/tsc-wrapped: 4.4.6
@ngtools/webpack: error
@schematics/package-update: 0.3.2
typescript: 2.4.2
webpack: error
Repro steps
- Step 1: Clone repo for test case https://github.com/andrewseguin/beautiful-day
- Step 2: Update CLI version from
^1.7.4
to6.0.0-rc.7
- Step 3: Install packages:
npm i
- Step 3: Run
ng update @angular/cli
Observed behavior
An error message is printed telling me that it cannot find a package.json
.
Could not find a package.json. Are you in a Node project?
Desired behavior
CLI successfully updates itself.
Mention any other details that might be useful (optional)
Do you intend to show a message when users update @angular/cli
to v6 using yarn? I noticed that with npm i
I see the following message:
====================================================================
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
====================================================================
But if I do the update using yarn
, no message is provided that lets me know to do anything.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
Cannot find module '@angular/compiler' - Stack Overflow
Problem was that I installed ng-mocks into the root-package.json which was of course wrong. I removed it there and installed it to the...
Read more >How To Update Angular CLI To Latest Version
First Update your Angular app to Angular 9. Then use ng update command. Angular CLI version check. Before updating check the Angular version ......
Read more >the installed angular cli version is older than the latest stable ...
When I run the command ng update @angular/material@8 , I get the following: ... An unhandled exception occurred: Could not find package.json See ......
Read more >Upgrading an Application to Angular 6: Step By Step - Blog
ng update. This command updates your package.json file to the latest Angular-related package versions. I was happy to see that it left all ......
Read more >Package List — Spack 0.20.0.dev0 documentation
Versions: 2.7.7; Build Dependencies: gnuconfig, python, java; Run ... A package universe and a request to install, remove, or upgrade packages have to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m having the same problem, and i’ve traced it down to a line in
@angular/cli/models/schematic-command.js:73
, wherethis.project.root
is set to my User folder, instead of the project folder. If I set the property to an absolute URL of the location of the project, the command goes through as expected. I’m not sure (yet) how theproject.root
is set, but maybe this information helpsEDIT After some more research, i’ve found that a reference to
.angular-cli.json
is missing from line https://github.com/angular/angular-cli/blob/c7088901b70d850cc818d002daa30dd100d57c22/packages/%40angular/cli/lib/cli/index.ts#L52 .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.