Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[ng update]: Error - The "@angular-devkit/schematics" package cannot be resolved from the workspace root directory

ng update 

The "@angular-devkit/schematics" package cannot be resolved from the workspace root directory. This may be due to an unsupported node modules structure. Please remove both the "node_modules" directory and the package lock file; and then reinstall. If this does not correct the problem, please temporarily install the "@angular-devkit/schematics" package within the workspace. It can be removed once the update is complete.

like image 289
Satish Singh Avatar asked Mar 05 '20 13:03

Satish Singh


People also ask

What is Devkit in angular?

DevKit was built to provide libraries that can be used to manage, develop, deploy, and analyze your code. DevKit has a schematics-cli command line tool that you can use to create your own Schematics.

Can't find module angular Devkit build angular?

To solve the error "Could not find module '@angular-devkit/build-angular'", make sure to install the package by opening your terminal in your project's root directory and running the following command: npm i -D @angular-devkit/build-angular and restart your IDE and development server.


2 Answers

I had this issue

First I ran this to see the structure of the package

npm ls @angular-devkit/schematics

it returned....

[email protected] C:\Users\wgrant\source\repos\WD\MMS\Mms\ClientApp

`-- (empty)

since it was empty I ran the following (if yours is not empty maybe try update instead of install)

npm install @angular-devkit/schematics

and after this, the 'ng update' ran successfuly

like image 143
Wes Grant Avatar answered Sep 24 '22 04:09

Wes Grant


first use the command

npm remove -g @angular/cli 

and then

npm install -g @angular/cli 

in my case solved and installed the latest version of the angular

like image 37
Fabio Silva Avatar answered Sep 22 '22 04:09

Fabio Silva