Can't install any nodes because of enoent problem

Describe the problem/error/question

When I install a node in the community, the bottom right corner shows Error loading package “n8n-nodes-respond-io”: Failed to execute npm command Cause: spawn npm ENOENT.

I cant install any nodes because of this error. I tried manuel installation but couldnt make it. I saw a solution which included shell:true. İ did it but not certain if i did it correctly.

What is the error message (if any)?

Error loading package “@respond-io/n8n-nodes-respond-io” :spawn npm ENOENT

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.1.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows 11

bro it points to this C:\Users\asaki\AppData\Roaming\npm

i tried all of them. There is problem with node and npm they work perfectly fine. Node is installed with acces to PATH

@Kuzey_Aras_Sakinc
I understand node and npm work in your terminal, but could you confirm whether the same shell/session that starts n8n also has access to npm? spawn npm ENOENT usually means the running n8n process is not seeing the same PATH/environment.

Yes i tried the node -v and npm -v commands and they work perfectly fine

I’d try open your terminal, cd into your .n8n/nodes folder, and run npm install @respond-io/n8n-nodes-respond-io manually. Restart n8n after that and the node should show up

i wrote that i tried it already :laughing:

I ran into the same issue on Windows, and it appears to be related to how Node.js executes npm commands via execFile when installing n8n community packages.

:white_check_mark: Fix

You can resolve it by patching the following file:
C:\Users<username>\AppData\Roaming\npm\node_modules\n8n\dist\modules\community-packages\npm-utils.js

Then locate the executeNpmCommand function and change this line:

const { stdout } = await asyncExecFile('npm', args, cwd ? { cwd } : undefined);

to

const { stdout } = await asyncExecFile(
  'npm',
  args,
  cwd ? { shell: true, cwd } : { shell: true }
);

After making this change, restart n8n. Community package installation should work correctly again.

I strongly advise against doing things like this :sweat_smile:

This issue was resolved around a month ago in 2.19.0, updating would be the best approach to take.