New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom storage adapter path when using ghost as an npm module #8754
Comments
HI @wolleysesom, it sounds as though you may be missing the paths entry in your config file, see: https://docs.ghost.org/docs/using-ghost-as-an-npm-module#section-create-a-custom-config-file Could you confirm this? If this is not the case can you please provide your full config file so we can verify if this is a bug or not. Thank you 😄 |
It has it. Here is full config { |
Got similar issue while setting custom "paths": {
"contentPath": "content/"
} With this config Ghost keeps looking in "paths": {
"contentPath": "content"
} path resolves correctly. |
@evenfrost Which storage adapter are you using? @wolleysesom
This is a wrong implementation in the If i am adding a plain custom storage adapter, it works fine for me. |
I see. You are using Ghost as NPM module. This looks like a bug yeah. Sorry for trouble. We should use If a config path contains a trailing slash (e.g. |
And now I'm stuck with exact issue related to using custom adapter. I'm using ghost-cloudinary-store and, when installing to Error: Cannot find module '/*path_to_blog_dir*/node_modules/ghost/core/server/adapters/storage/ghost-cloudinary-store' So it looks for the storage in wrong directory. My "paths": {
"contentPath": "content"
} However, when I change config to "paths": {
"contentPath": "content/"
} The not found error is still here, and another error occurs, which I've already mentioned before: NAME: NotFoundError
CODE: ENOENT
MESSAGE: The currently active theme "gost" is missing. (I'm using custom theme named 'gost'). Is there any workaround or at least schedule when it is going to be fixed? My blog development is pretty hung because of this. |
If you set your The relative usage is a bug
If you set a custom content path, your active theme must be located inside your custom path. FYI: |
Yeah, I've already updated Error: Cannot find module '/*path_to_blog_dir*/node_modules/ghost/core/server/adapters/storage/ghost-cloudinary-store'
> cp -r /wherever-i-cloned-ghost-cloudinary-store /*path_to_blog_dir*/node_modules/ghost/core/server/adapters/storage
# works! Though I guess it should look not in |
Cool. Would be helpful for others to PR your changes back to the original repository. As soon as you are ready :)
|
Sure, will do when I test it a bit more.
I absolutely agree on that, but how can I fix this error then: Error: Cannot find module '/*path_to_blog_dir*/node_modules/ghost/core/server/adapters/storage/ghost-cloudinary-store' |
Bump. I'm having the same issue with the
|
Can you please try to set your content path to an absolute path?
|
@kirrg001 tried setting content path to an absolute path. Still experiencing the same issue. |
@kirrg001 I was trying this adapter https://github.com/thombuchi/ghost-google-cloud-storage, but it seems to be out of date. I'm now trying this other one https://github.com/O-io/ghost-storage-adapter-gcloud which seems to be working fine. |
I'm experiencing this issue without a custom storage adapter. I'm hosting my blog on Digital Ocean with their one click app setup but further customized it by using Ghost as an NPM module and upgraded to v1.9. If I use an absolute path for This issue only occurs in production, which is on a Linux VPS. I can use an absolute path in development on OSX just fine. |
EDIT**: Issue has been solved, I didn't have all of the folders needed for a custom content path. Hello, I am also experiencing this issue. Is there a definite fix yet? I have tried using absolute paths for my storage and it still happens. my config file (config.development.json) I have the file content/adapters/storage/Mongodb.js as well. I have tried content, content/ and a full absolute path from the Users menu. |
@jacobian Thanks for the update 👍 |
This is occuring for me using the Google Cloud Storage module |
I am also running all this on Google App Engine |
…roblem that goes to see the module under `node_modules /` as a relative path. refs: TryGhost/Ghost#8754
Ran into the same issue. I ended up creating a task that generates paths: {
contentPath: path.join(__dirname, '/content'),
} |
Is this issue fixed? because the content path is still using the one inside node_modules.. |
@Narutuffy Not fixed. The issue is still open. |
Still getting this issue. Can't load themes, storage adapters or anything. Always looking in |
Having this issue also. Will post back if I come up with a solution. |
OK So the absolute path fixed this for me.
I am still having a problem with S3 Storage Adapter (path to but that's a discussion for another time). |
I also found an absolute path fixes this issue, but it's an annoying workaround. It would be great to get the root cause fixed, absolute paths should be optional at best. |
Closing due to age and lack of traction. We're no longer actively supporting installing Ghost as an npm module. PRs are still always welcome. |
@ErisDS ah - that's interesting, can you point me in the direction of this npm module support announcement? Tbh, as an npm module is our, and the primary use case of quite a few companies who pointed me in the direction of it as a blogging engine. I should probably let them know! |
This is pretty much a bug regardless of whether you support ghost being installed as an npm module or not. @ErisDS it should be fixed. |
@CMCDragonkai Please use our forum if you need help. If it turns out there is a bug in Ghost, we can raise a new bug issue 👍 |
@kirrg001 This is definitely a bug. Using |
@kirrg001 agree about using a new bug for this, as the |
I am using Ghost as an NPM module, and I am trying to get it to work with a custom storage adapter. However, it is looking under \node_modules\ghost\core\server\adapters\storage instead of \content\adapters\storage for the custom storage adapter.
Steps to Reproduce
expected: ghost being able to find the module
actual: ghost looks in \node_modules\ghost\core\server\adapters\storage instead and unable to find the storage adapter
Technical details:
The text was updated successfully, but these errors were encountered: