Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aomaryus opened this issue Mar 28, 2024 · 2 comments

Comments

@aomaryus
Copy link

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.

@aomaryus
Copy link
Author

grunt file
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

shell: {
  cypress: {
    command: function (env, user, mode) {

....

@aomaryus
Copy link
Author

I am not using grunt any more.
Thanks for everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant