Ghost npm module, ContentPath for Storage Adaptors


#1

I’ve got an issue using storage adaptors and ghost ran as an npm module. When I run ghost I get error saying “cant find module”, and its looking for the npm module in my theme directory, rather than in the project root.

project/node_modules/ghost/core/server/adapters/storage/s3

Its something to do with the contentPath, but I’m not sure how to fix this. This is my contentpath:

    paths: {
      contentPath: path.join(__dirname, "content")
    }

#2

Hey @graemepaul! Think this github issue and discussion in it could be helpful for your problem :wink: The best way around contentPath issue is using an absolute path for your contentPath config.


#3

Thanks for the replying, absolute path still doesn’t work with the Storage adaptors. I tried to change my absoloute path from

path.join(__dirname, "content") to
contentPath: "/Users/graeme/Sites/helloworld/content/"


#4

Did you try without trailing slash in the end, like: contentPath: "/Users/graeme/Sites/helloworld/content" ?


#5

I tried that aswell, didnt work