Skip to content
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

Cannot find a way to start it #26

Open
quentinglorieux opened this issue Jan 15, 2023 · 5 comments
Open

Cannot find a way to start it #26

quentinglorieux opened this issue Jan 15, 2023 · 5 comments

Comments

@quentinglorieux
Copy link

I get this error: unknown command 'extension:searchsync'
What am I missing ?

@keniobats
Copy link

I'm having the same issue. Do you have any updates on this?. Thanks

@keniobats
Copy link

Hi @quentinglorieux

I've just did it (by chance). You just have to position inside the extensions/directus-extension-searchsync/ directory and run the "npx directus". This will load the plugin.

/directus/extensions $ npx directus
Usage: directus [command] [options]

Options:
  -v, --version        output the version number
  -h, --help           display help for command

Commands:
  start                Start the Directus API
  init                 Create a new Directus Project
  security
  database
  users
  roles
  count <collection>   Count the amount of items in a given collection
  bootstrap [options]  Initialize or update the database
  schema
  help [command]       display help for command
[14:44:53.559] WARN: Couldn't load extensions
[14:44:53.559] WARN: Current folder does not contain a package.json file
    err: {
      "type": "Error",
      "message": "Current folder does not contain a package.json file",
      "stack":
          Error: Current folder does not contain a package.json file
              at getPackageExtensions (/directus/node_modules/@directus/shared/dist/cjs/utils/node/get-extensions.js:84:15)
              at async ExtensionManager.getExtensions (/directus/node_modules/directus/dist/extensions.js:249:35)
              at async ExtensionManager.load (/directus/node_modules/directus/dist/extensions.js:183:31)
              at async ExtensionManager.initialize (/directus/node_modules/directus/dist/extensions.js:97:13)
              at async createCli (/directus/node_modules/directus/dist/cli/index.js:27:5)
    }
/directus/extensions $ cd directus-extension-searchsync/
/directus/extensions/directus-extension-searchsync $ ls
LICENSE            README.md          index.js           jsconfig.json      lib                node_modules       package-lock.json  package.json       types.ts
/directus/extensions/directus-extension-searchsync $ npx directus
Usage: directus [command] [options]

Options:
  -v, --version         output the version number
  -h, --help            display help for command

Commands:
  extension:searchsync
  start                 Start the Directus API
  init                  Create a new Directus Project
  security
  database
  users
  roles
  count <collection>    Count the amount of items in a given collection
  bootstrap [options]   Initialize or update the database
  schema
  help [command]        display help for command
[14:45:36.665] INFO: Loaded extensions: directus-extension-searchsync

But now I'm facing an indexing issue wich I don't know how to solve really:

/directus/extensions/directus-extension-searchsync $ npx directus extension:searchsync index [14:56:28.589] INFO: Loaded extensions: directus-extension-searchsync [14:56:28.807] WARN: Cannot drop collection "prueba". Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.830] WARN: Cannot index "prueba/3". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.835] WARN: Cannot index "prueba/4". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.841] WARN: Cannot index "prueba/5". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.848] WARN: Cannot index "prueba/6". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.853] WARN: Cannot index "prueba/7". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.858] WARN: Cannot index "prueba/8". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.864] WARN: Cannot index "prueba/9". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.870] WARN: Cannot index "prueba/10". Error: Request failed with status code 400 extension: "directus-extension-searchsync" [14:56:28.876] WARN: Cannot index "prueba/2". Error: Request failed with status code 400 extension: "directus-extension-searchsync"

@LeBenLeBen
Copy link

What is your setup? Are you using Docker?

@keniobats
Copy link

@LeBenLeBen Yes, I'm using docker engine v20, directus v9.23.1 and ELK Stack v 8.4.2

@LeBenLeBen
Copy link

LeBenLeBen commented Mar 14, 2023

Installing extensions from npm in the defaut Directus setup doesn’t work very well since the container doesn’t use the package.json. I personally created a custom container that load and install a local package.json where I installed the extension.

You can check my setup here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants