Hi,
I’m just trying to familiarize myself with the Ghost APIs and tried to require the Admin API with
const GhostAdminAPI = require('@tryghost/admin-api')
in the node shell with running the node
command in the Ghost directory.
It throws this error though:
$ node
> const GhostAdminAPI = require(’@tryghost/admin-api’)
Thrown:
{ Error: Cannot find module ‘@tryghost/admin-api’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18) code: ‘MODULE_NOT_FOUND’ }
The @tryghost/admin-api is in the respective node_modules folder.
Can anyone help?
If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:
- What’s your URL? This is the easiest way for others to debug your issue
- What version of Ghost are you using? 3.2.0
- What configuration?
- What browser?
- What errors or information do you see in the console?
- What steps could someone else take to reproduce the issue you’re having?