{"record":{"id":"1e6584d1a2b8cf73","repo":"Unitech/pm2","slug":"interpreter-app-exec-interpreter-is-not-availab","errorCode":null,"errorMessage":"Interpreter ${app.exec_interpreter} is NOT AVAILABLE in PATH. (type 'which ${app.exec_interpreter}' to double check.)","messagePattern":"Interpreter (.+?) is NOT AVAILABLE in PATH\\. \\(type 'which (.+?)' to double check\\.\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/Common.js","lineNumber":464,"sourceCode":"  if (app.exec_interpreter.indexOf('python') > -1)\n    app.env.PYTHONUNBUFFERED = '1'\n\n  if (app.exec_interpreter == 'lsc') {\n    app.exec_interpreter = path.resolve(__dirname, '../node_modules/.bin/lsc');\n  }\n\n  if (app.exec_interpreter == 'coffee') {\n    app.exec_interpreter = path.resolve(__dirname, '../node_modules/.bin/coffee');\n  }\n\n  if (app.exec_interpreter != 'none' && which(app.exec_interpreter) == null) {\n    // If node is not present\n    if (app.exec_interpreter == 'node') {\n      Common.warn(`Using builtin node.js version on version ${process.version}`)\n      app.exec_interpreter = cst.BUILTIN_NODE_PATH\n    }\n    else\n      throw new Error(`Interpreter ${app.exec_interpreter} is NOT AVAILABLE in PATH. (type 'which ${app.exec_interpreter}' to double check.)`)\n  }\n\n  return app;\n};\n\nCommon.deepCopy = Common.serialize = Common.clone = function(obj) {\n  if (obj === null || obj === undefined) return {};\n  return fclone(obj);\n};\n\nCommon.errMod = function(msg) {\n  if (process.env.PM2_SILENT || process.env.PM2_PROGRAMMATIC === 'true') return false;\n  if (msg instanceof Error)\n    return console.error(msg.message);\n  return console.error(`${cst.PREFIX_MSG_MOD_ERR}${msg}`);\n}\n\nCommon.err = function(msg) {","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/Unitech/pm2/blob/31adee8048dbbc1ee36a7df7cdbcaca2559708df/lib/Common.js#L446-L482","documentation":"Before launching an app, PM2 verifies the configured exec_interpreter is resolvable via which(). If not found it throws to prevent a silent spawn failure — except for the special 'node' case, which falls back to the bundled node interpreter. Any other missing interpreter aborts.","triggerScenarios":"Setting interpreter to a runtime that isn't installed or isn't on the PM2 daemon's PATH (python3, php, ruby, deno, ts-node), or misspelling the interpreter name.","commonSituations":"Container missing the runtime; local dev where the interpreter is installed via nvm/asdf but PATH isn't propagated to the (already-running) PM2 daemon; typo in interpreter.","solutions":["Install the interpreter and ensure it is on PATH for the PM2 daemon, then restart the daemon (pm2 kill && pm2 resurrect).","Reference the interpreter by absolute path.","Set interpreter:'none' if the script is directly executable.","For node-based apps use interpreter:'node' to hit the bundled-node fallback."],"exampleFix":"// before\n{ script: 'main.py', interpreter: 'python3' }\n// after\n{ script: 'main.py', interpreter: '/usr/bin/python3' }","handlingStrategy":"validation","validationCode":"const which = require('which');\nfunction resolveInterpreter(interp) {\n  if (!interp || interp === 'none') return interp;\n  if (which(interp, { nothrow: true }) == null && interp !== 'node') {\n    throw new Error(`Interpreter '${interp}' not found on PATH; install it or use an absolute path`);\n  }\n  return interp;\n}\napp.exec_interpreter = resolveInterpreter(app.exec_interpreter);","typeGuard":"const interpreterAvailable = (i) => !i || i === 'none' || i === 'node' || which(i, { nothrow: true }) != null;","tryCatchPattern":null,"preventionTips":["Restart the PM2 daemon (pm2 kill && pm2 resurrect) after installing runtimes or changing PATH.","Reference interpreters by absolute path in production configs.","Verify `which <interpreter>` succeeds in the daemon's environment, not just your shell."],"tags":["interpreter","path","spawn"],"backgroundTag":null,"analyzedSha":"31adee8048dbbc1ee36a7df7cdbcaca2559708df","analyzedAt":"2026-08-13T03:49:51.765Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}