You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NPM Run Configuration: cannot execute some scripts from package.json #1899
I have a NPM run configuration pointing to an existing package.json (which is not in the root-directory of the project but within a subfolder):
However, executing the run configuration does not work:
npm error code ENOENT
npm error syscall open
npm error path /Users/ev/ide/app/package.json
npm error errno -2
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/Users/ev/ide/app/package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /Users/ev/.npm/_logs/2025-08-03T00_54_31_316Z-debug-0.log
The log says that package.json cannot be found in /Users/ev/ide/app/package.json, although it should look in /Users/ev/ide/app/src/main/webui/package.json as specified in the launch configuration. I also tried with absolute path (= /Users/ev/ide/app/src/main/webui/package.json) in the launch configuration - it shows the same error.
Ok, adding a run config with test or install works for me, too. And there is no subpath-issue but with executing scripts such as dev, build, lint or preview:
changed the title [-]NPM Run Configuration: does not work if `package.json` is within subpath[/-][+]NPM Run Configuration: cannot execute some scripts from `package.json`[/+]on Aug 3, 2025
I still cannot reproduce the issue. From the given reproducer project, can you please share details to reproduce from a clean workspace (including how the project is imported, what UI entry-points do you use to run npm..._ ?
Then I created a new Eclipse static web project called "webui" and the content of the created webui becomes visible.
Then I executed npm install
Then I created the launch configuration for dev (see picture above)
Then I wanted to execute the Npm command dev. Executing npm run dev from the terminal works without issues, but executing it from the Launch configuration (see picture above), does not work - it shows in the terminal:
Unknown command: "build"
Did you mean this?
npm run build # run the "build" package script
To see a list of supported npm commands, run:
npm help
what UI entry-points do you use to run npm
cd webui
npm install
npm run dev //works from the terminal but not from the Launch configuration (see above)
I also tried using run build instead of build:
But it doesn't work either - the terminal output:
> webui@0.0.0 build
> tsc -b && vite build
env: node: No such file or directory
It looks like node is not well detected on your machine; and npm may be misconfigured. It could again be different on your machine because it's a mac, and as you probably notice, mac tends to be undertested/undersupported by the community by lack of maintainers using it.
In Help > About Eclipse IDE > Installation Details > Plugins tab; please search for "node.js" and report what you see there.
In Help > About Eclipse IDE > Installation Details > Plugins tab; please search for "node.js" and report what you see there.
It looks like node is not well detected on your machine; and npm may be misconfigured.
node/npm are globally available from the terminal:
which node
/opt/homebrew/bin/node
which npm
/opt/homebrew/bin/npm
Running node/npm from the Eclipse terminal also works, BUT ONLY if I set Arguments: --login (btw: on a new Eclipse installation, it does not set Arguments: --login , so perhaps it would be useful to set this by default):
I assume that Eclipse WWD or Eclipse NPM Launch Configuration wants to execute its command without terminal argument --login. Because without --login, node/npm is indeed not found by eclipse terminal and launch configuration:
// Executed from within the Eclipse Terminal without --login argument
which node
node not found
which npm
npm not found
To sum up:
Eclipse WWD or Eclipse NPM Launch Configuration should always run their tasks with the terminal argument --login. Unfortunately, the Eclipse terminal settings are delegated to Eclipse NPM Launch Configuration. Therefore, it would be good if Eclipse NPM Launch Configuration could use the custom Eclipse terminal settings or always run its tasks with --login. Alternatively, an input field could be added where the user can enter terminal arguments when running a task:
I am experiencing the issue with a NPM run configuration where the package.json is not in the root-directory which was first mentioned by @nimo23.
Intention:
I want to create a run configuration with relative paths/variables to put into my code repository. So every developer working with this repository may run these configurations in there own environment.
Problem:
After setting up my project structure and adding NPM run configurations, I got errors when running these configurations.
Investigation:
Because I used 'Save as' -> 'Shared file' when creating the run configuration, I had a look at the run configuration file:
The configuration shows a empty string value for org.eclipse.debug.core.ATTR_WORKING_DIRECTORY. So I tried to set this value to the package.json location:
Now the run configuration seem to work and can be executed from the run configurations menu or context menu:
But as soon as I try to edit the run configuration, the org.eclipse.debug.core.ATTR_WORKING_DIRECTORY value gets reset, and it does not work anymore. Sometimes it is empty, sometimes it points to the location of the shared run configuration file which both makes the run configuration stop working.
I set up a simple eclipse project to reproduce the behaviour: npm-launch-test.zip
The project and its run configurations are properly set and ready to launch from context menu:
Once you open the run configuration wizard and press 'Run', it should be broken:
While investigation the issue, I noticed another issue with the run configuration. It is not possible to execute scripts with whitespace in its name. It seams the quotation of the command parameters is broken. Please find the run configuration in my npm-launch-test project:
Activity
mickaelistria commentedon Aug 3, 2025
I'm having trouble to reproduce with a simple project.
I tried
{ "scripts": { "test": "echo lol" } }I think try Run As > NPM... on context-menu of the package.json file)
And I get a console showing the exepcted
Can you please try finding such a minimal project that allows you to reproduce the issue and shared more detailed steps to reproduce from scratch?
nimo23 commentedon Aug 3, 2025
Ok, adding a run config with
testorinstallworks for me, too. And there is no subpath-issue but with executing scripts such asdev,build,lintorpreview:For example, adding run config
build:and executing, leads to:
How to solve this?
Reproducer:
webui.zip
[-]NPM Run Configuration: does not work if `package.json` is within subpath[/-][+]NPM Run Configuration: cannot execute some scripts from `package.json`[/+]mickaelistria commentedon Aug 3, 2025
I still cannot reproduce the issue. From the given reproducer project, can you please share details to reproduce from a clean workspace (including how the project is imported, what UI entry-points do you use to run npm..._ ?
nimo23 commentedon Aug 3, 2025
npm create vite@latest webui -- --template react-tsThen I created a new Eclipse static web project called "webui" and the content of the created
webuibecomes visible.Then I executed
npm installThen I created the launch configuration for
dev(see picture above)Then I wanted to execute the Npm command
dev. Executingnpm run devfrom the terminal works without issues, but executing it from the Launch configuration (see picture above), does not work - it shows in the terminal:I also tried using
run buildinstead ofbuild:But it doesn't work either - the terminal output:
mickaelistria commentedon Aug 3, 2025
It looks like
nodeis not well detected on your machine; andnpmmay be misconfigured. It could again be different on your machine because it's a mac, and as you probably notice, mac tends to be undertested/undersupported by the community by lack of maintainers using it.In Help > About Eclipse IDE > Installation Details > Plugins tab; please search for "node.js" and report what you see there.
nimo23 commentedon Aug 3, 2025
node/npm are globally available from the terminal:
Running node/npm from the Eclipse terminal also works, BUT ONLY if I set
Arguments: --login(btw: on a new Eclipse installation, it does not setArguments: --login, so perhaps it would be useful to set this by default):I assume that
Eclipse WWDorEclipse NPM Launch Configurationwants to execute its command without terminal argument--login. Because without--login, node/npm is indeed not found by eclipse terminal and launch configuration:To sum up:
Eclipse WWDorEclipse NPM Launch Configurationshould always run their tasks with the terminal argument --login. Unfortunately, theEclipse terminalsettings are delegated toEclipse NPM Launch Configuration. Therefore, it would be good ifEclipse NPM Launch Configurationcould use the customEclipse terminalsettings or always run its tasks with--login. Alternatively, an input field could be added where the user can enter terminal arguments when running a task:trolst commentedon Dec 17, 2025
I am experiencing the issue with a NPM run configuration where the package.json is not in the root-directory which was first mentioned by @nimo23.
Intention:

I want to create a run configuration with relative paths/variables to put into my code repository. So every developer working with this repository may run these configurations in there own environment.
Problem:

After setting up my project structure and adding NPM run configurations, I got errors when running these configurations.
Investigation:
Because I used 'Save as' -> 'Shared file' when creating the run configuration, I had a look at the run configuration file:
The configuration shows a empty string value for
org.eclipse.debug.core.ATTR_WORKING_DIRECTORY. So I tried to set this value to the package.json location:Now the run configuration seem to work and can be executed from the run configurations menu or context menu:


But as soon as I try to edit the run configuration, the
org.eclipse.debug.core.ATTR_WORKING_DIRECTORYvalue gets reset, and it does not work anymore. Sometimes it is empty, sometimes it points to the location of the shared run configuration file which both makes the run configuration stop working.I set up a simple eclipse project to reproduce the behaviour:
npm-launch-test.zip
The project and its run configurations are properly set and ready to launch from context menu:

Once you open the run configuration wizard and press 'Run', it should be broken:

While investigation the issue, I noticed another issue with the run configuration. It is not possible to execute scripts with whitespace in its name. It seams the quotation of the command parameters is broken. Please find the run configuration in my npm-launch-test project:
Result:
Executing npm run "test with space" from terminal works.