0

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'."

Touré Holder
  • 2,768
  • 2
  • 22
  • 20

2 Answers2

5

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.

julianobrasil
  • 8,954
  • 2
  • 33
  • 55
0

Looks like this was removed in version 10+.

Downgrading to 9.1.12 got me the buildDefaultPath method I wanted.

npm uninstall @schematics/angular
npm i @schematics/angular@9.1.12
Touré Holder
  • 2,768
  • 2
  • 22
  • 20