root@mail:~# head -20 $(which n8n)
#!/usr/bin/env node
const path = require(‘path’);
// Make sure that it also find the config folder when it
// did get started from another folder that the root one.
process.env.NODE_CONFIG_DIR = process.env.NODE_CONFIG_DIR || path.join(__dirname, ‘config’);
// Check if version should be displayed
const versionFlags = [‘-v’, ‘-V’, ‘–version’];
if (versionFlags.includes(process.argv.slice(-1)[0])) {
console.log(require(‘../package’).version);
process.exit(0);
}
This typically happens when there is a mismatch between the global binary (/root/.nvm/.../bin/n8n) and the actual package files in node_modules, often caused by an interrupted upgrade or “ghost” files from the older version (2.02) persisting in the NVM directory.
I’m having the same issue, getting an Error: Command “start” not found after updating from 2.27.5 to 2.28.4. I’ve reverted to 2.27.5 and it’s running again.
Before trying the steps mentioned by @kjooleng a maybe stupid question: what happens to my workflows, credentials etc. when uninstalling n8n as described?
@mkhalid this should be resolved next week, we think we know where the issue is and have the PR in place to handle it.
I would recommend using the container though, we put up a post a couple of weeks ago talking about removing npm as an install option so if might be better to swap to containers.