angularangular-cliangular-schematics

Could not find a declaration file for module '@schematics/angular/utility/project'


I want to use the buildDefaultPath method usually available in '@schematics/angular/utility/project' to write an Angular schematics.

I installed the package with npm i @schematics/angular and tried to import it like this: import { buildDefaultPath } from '@schematics/angular/utility/project';.

However, I get "Could not find a declaration file for module '@schematics/angular/utility/project'."


Solution

  • You can find the missing function in:

    import { buildDefaultPath } from '@schematics/angular/utility/workspace';

    It was removed from @schematics/angular/utility/project because it was a duplicate of the method in workspace file.