Cannot find module '\current\index.js'

  • How was Ghost installed and configured?
    Using local installation through the CLI

  • What errors or information do you see in the console?

Debug Information:
    OS: Microsoft Windows 11 Home Single Language, v10.0.22621
    Node Version: v16.13.0
    Ghost Version: 5.25.2
    Ghost-CLI Version: 1.23.1
    Environment: development
    Command: 'ghost start'
Message: 
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'D:\Programming\WebApps\roundtable-cms\current\index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Stack: Error: 
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'D:\Programming\WebApps\roundtable-cms\current\index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

    at ChildProcess.<anonymous> (C:\Users\User\AppData\Roaming\nvm\v16.13.0\node_modules\ghost-cli\lib\utils\local-process.js:65:35)
    at ChildProcess.emit (node:events:390:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
  • What steps could someone else take to reproduce your issue?
    I’m unsure what went wrong, it was working all along until I started installing tailwindcss into my theme (probably not directly correlated) But as far as I can tell the “current” folder shortcut does not send me anywhere now. I suspect the “current” folder has been deleted?.. And if so how can i get it back?

I’m quite surprised more people don’t get this issue: I’ve discovered that this happens when the directory that Ghost is in is renamed. The issue primarily comes from the symlink current that points to a subdirectory under version/ which becomes erroneous when the directory name is changed.

There are two ways I’ve been able to solve this issue. One, you could revert the folder name change. Or if you want the directory name change to be reflected by ghost, make a new symlink that points to the correct subdirectory under versions/ and in your config.development.json file change the database.client.connection.filename key and paths.contentPath. :slightly_smiling_face: