Skip to content

Issue launching grunt after upgrading to Angular 16 due to locate-path versions  #1772

@aomaryus

Description

@aomaryus

After upgrading to Angular 16 we see this error

grunt -h

Loading "gruntfile.js" tasks...ERROR

Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/locate-path/index.js from .../node_modules/pkg-up/node_modules/find-up/index.js not supported.
Instead change the require of .../node_modules/locate-path/index.js in .../nacd-ui/node_modules/pkg-up/node_modules/find-up/index.js to a dynamic import() which is available in all CommonJS modules.
Grunt: The JavaScript Task Runner (v1.6.1)

Angular uses locate-path 7.o and Grunt uses 3.0
Here is our tsconfig.json

{
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"downlevelIteration": true,
"target": "ES2022",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"ES2022",
"dom"
],
"module": "ES2022",
"baseUrl": "./",

},
"angularCompilerOptions": {
"disableTypeScriptVersionCheck": true
}
}

Could you please take a look?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions