A problem occurred evaluating settings 'src'

I have a task

task auditCheckUILibrary(type: NpmTask) {
onlyIf {
!project.hasProperty(‘skip-frontend-build’)
}
inputs.files(“frontend/src/”, “frontend/test/”, “frontend/public/”)
outputs.upToDateWhen { true }
args = [‘run’, ‘audit-check-ui-lib’]
execOverrides {
it.workingDir = ‘frontend’
}
}

Execution failed

Process ‘command ‘/home/dev/Desktop/X-Road/src/proxy-ui-api/.gradle/nodejs/node-v14.18.1-linux-x64/bin/npm’’ finished with non-zero exit value 1

more logs:

:scream: Unresolved issues found!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @niis/shared-ui@0.1.0 check-audit: check-audit
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @niis/shared-ui@0.1.0 check-audit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/oleksii/.npm/_logs/2022-01-09T23_08_53_245Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.1.0 audit-check-ui-lib: cd ../../shared-ui && npm run check-audit
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0 audit-check-ui-lib script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! /home/oleksii/.npm/_logs/2022-01-09T23_08_53_275Z-debug.log

FAILURE: Build failed with an exception.

  • Where:
    Settings file ‘/home/dev/Desktop/X-Road/src/settings.gradle’ line: 2

  • What went wrong:
    A problem occurred evaluating settings ‘src’.

Could not find method plugins() for arguments [settings_3ajnivmgvub9z0qttf6tp5t7d$_run_closure1$_closure2@6f0251a2] on object of type org.gradle.plugin.management.internal.DefaultPluginManagementSpec.

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.GradleScriptException: A problem occurred evaluating settings ‘src’.

I found gradle error difficult to debug and understand.
Could someone please advice how to debug this error?

What happens, if you execute the npm commands manually?
Local package.json exists, but node_modules missing, did you mean to install? this sound like you need to run npm install first.

Thank you for reply Christian.
I tried it, but I am not sure where to execute the command.
If I am calling in /src/proxy-ui-api/.gradle/nodejs/node-v14.18.1-linux-x64/bin directory

I am getting:

enoent ENOENT: no such file or directory, open ‘/home/oleksii/Desktop/X-Road/src/proxy-ui-api/.gradle/nodejs/node-v14.18.1-linux-x64/bin/package.json’
But the dir has package-lock.json file.

There is an installUILibrary task, which calls npm install.

Thank you Christian for your support. I ran the installUILibrary task successfully, but it didn’t help for original auditCheckUILibrary task.

This is not really a gradle problem.

Install npm and find out, what commands need to be executed and in which order.
Then use the same commands in gradle NpmTasks. If you have to execute multiple npm commands let the gradle tasks depend on each other.