Pulumi Error: 'failed to load language plugin nodejs' — Cause, Fix, and Troubleshooting Guide
Fix Pulumi 'failed to load language plugin nodejs: fork/exec: no such file or directory' — missing pulumi-language-nodejs, wrong runtime, or Node off PATH.
- #pulumi
- #iac
- #troubleshooting
- #errors
Fixing errors like this? Get 500 free DevOps AI prompts
500 copy-paste AI prompts for the stack you actually run — one PDF, free.
Overview
error: failed to load language plugin nodejs means the Pulumi CLI tried to start the Node.js language host — a helper binary named pulumi-language-nodejs that runs your TypeScript/JavaScript program — and failed to launch it. When the tail of the message is fork/exec ...: no such file or directory, the operating system could not find or execute that binary (or a program it in turn depends on, like node).
Pulumi ships one language host per supported runtime, installed alongside the CLI. This error is about the plugin/runtime plumbing, not your program code: the host either isn’t installed, isn’t on PATH, the project’s runtime is misdeclared, or Node itself isn’t available to the host.
error: failed to load language plugin nodejs: could not read plugin [/root/.pulumi/bin]
from cache: loading plugin: fork/exec /root/.pulumi/bin/pulumi-language-nodejs: no such file or directory
Symptoms
- Any Pulumi command that runs the program (
pulumi up,preview,destroy,refresh) fails immediately withfailed to load language plugin nodejs. - The message ends in
fork/exec ...: no such file or directory(binary not found) orpermission denied(not executable). - It happens on a freshly installed CLI, a broken/partial install, or inside a minimal container image.
pulumi versionworks, but any real operation fails at the language-host step.
Common Root Causes
1. Broken or partial Pulumi CLI install (missing pulumi-language-nodejs)
The pulumi-language-nodejs binary normally sits next to the pulumi binary. If the install was partial (interrupted download, a container that copied only pulumi), the host is missing and fork/exec fails.
$ ls "$(dirname "$(command -v pulumi)")" | grep language
# expected: pulumi-language-nodejs — if absent, that's the problem
2. Wrong runtime in Pulumi.yaml
If Pulumi.yaml declares a runtime that doesn’t match your project (or is malformed), Pulumi looks for the wrong language host. For a Node.js project it must be nodejs.
name: my-infra
runtime: node # wrong — must be exactly `nodejs`
3. Node.js not installed or not on the host’s PATH
pulumi-language-nodejs itself invokes node. If Node isn’t installed, or isn’t on the PATH visible to the process that launched Pulumi (a common gotcha with systemd services, cron, and nvm), the host fails to start.
fork/exec node: no such file or directory
4. Language-host binary is present but not executable
File permissions got stripped (e.g. an archive extracted without the execute bit, or a restrictive umask/volume mount), so the OS refuses to exec it.
fork/exec /root/.pulumi/bin/pulumi-language-nodejs: permission denied
5. Architecture/OS mismatch of the CLI binary
A CLI built for a different CPU architecture (e.g. an arm64 binary on amd64, or musl vs glibc in Alpine) can fail to exec the host. This overlaps with exec format error.
How to Diagnose
Confirm the CLI is whole, Node is reachable, and the project runtime is right.
# Is the CLI complete? Locate the language host next to pulumi.
command -v pulumi
ls -l "$(dirname "$(command -v pulumi)")"/pulumi-language-nodejs
# Does the environment have Node on PATH (same shell/user Pulumi runs as)?
command -v node && node --version
# What runtime does the project declare?
cat Pulumi.yaml # must show: runtime: nodejs (or runtime.name: nodejs)
# Verbose logs show exactly which path failed to exec.
pulumi preview --logtostderr -v=9 2> pulumi-debug.log
grep -i "language plugin\|fork/exec" pulumi-debug.log
# In systemd/cron/nvm contexts, PATH is often minimal — check it explicitly.
systemctl show -p Environment your-service 2>/dev/null
echo "$PATH"
Fixes
Reinstall the Pulumi CLI (restores the language host): A clean reinstall puts pulumi-language-nodejs back next to pulumi.
# Official installer (Linux/macOS)
curl -fsSL https://get.pulumi.com | sh
# or Homebrew
brew reinstall pulumi
pulumi version
ls -l "$(dirname "$(command -v pulumi)")"/pulumi-language-nodejs
Set the correct runtime in Pulumi.yaml: Use exactly nodejs; optionally pin options.
name: my-infra
runtime:
name: nodejs
options:
typescript: true # use built-in ts-node transpilation
packagemanager: npm # npm | yarn | pnpm
Put Node on PATH for the process that runs Pulumi: Ensure node is installed and reachable by the exact user/service. For systemd + nvm, symlink Node into a system path or set the service PATH.
# Make nvm-managed Node visible to system services.
sudo ln -sf "$(command -v node)" /usr/local/bin/node
sudo ln -sf "$(command -v npm)" /usr/local/bin/npm
# Or, in a systemd unit:
# [Service]
# Environment=PATH=/usr/local/bin:/usr/bin:/bin
Restore the executable bit: If the host exists but won’t exec, fix permissions.
chmod +x "$(dirname "$(command -v pulumi)")"/pulumi-language-nodejs
pulumi preview
Match the CLI to your OS/arch: In containers, install the Pulumi binary built for the image’s architecture and libc (use a glibc-based image, or the correct arm64/amd64 build). Then re-run.
uname -m # amd64/x86_64 vs aarch64/arm64
pulumi version # confirm the CLI runs at all on this arch
What to Watch Out For
pulumi versionsucceeding proves only the CLI runs — the language host is a separate binary that must also be present and executable.- systemd, cron, and CI often have a minimal PATH; Node being on your interactive PATH doesn’t mean the service can see it.
runtimemust be exactlynodejs—node,js, ortypescriptare not valid runtime names.- Alpine (musl) images frequently trip
exec format error/loader issues; prefer a glibc base or the musl-compatible build. - After reinstalling the CLI, verify the language host path in the same shell Pulumi will actually run in.
Related Guides
- Pulumi Error: ‘could not find any node_modules folder’ — Troubleshooting Guide
- Pulumi Error: ‘error reading from server: EOF’ — Troubleshooting Guide
- Pulumi Error: ‘could not load plugin’ — Troubleshooting Guide
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.