directus-labs / directus-template-cli Goto Github PK
View Code? Open in Web Editor NEWApply "templates" to a new, empty Directus project.
License: MIT License
Apply "templates" to a new, empty Directus project.
License: MIT License
When applying the Agency OS template, I am receiving the following error:
Error updating block_gallery_files [
{
message: 'Invalid foreign key for field "directus_files_id" in collection "block_gallery_files".',
extensions: {
code: 'INVALID_FOREIGN_KEY',
collection: 'block_gallery_files',
field: 'directus_files_id'
}
}
]
The CLI then finishes, but when I try to then load the Nuxt site's homepage, I get the following
{
"url": "/",
"statusCode": 500,
"statusMessage": "",
"message": "Cannot read properties of null (reading 'id')",
"stack": "<pre><span class=\"stack\">at ./components/base/VGallery.vue:101:17</span>\n<span class=\"stack internal\">at Module.ssrRenderList (./node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:433:7)</span>\n<span class=\"stack\">at _sfc_ssrRender (./components/base/VGallery.vue:96:26)</span>\n<span class=\"stack internal\">at renderComponentSubTree (./node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:683:9)</span>\n<span class=\"stack internal\">at renderComponentVNode (./node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:631:12)</span>\n<span class=\"stack internal\">at Module.ssrRenderComponent (./node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:86:10)</span>\n<span class=\"stack\">at ./components/blocks/Gallery.vue:75:40</span>\n<span class=\"stack internal\">at renderFnWithContext (./node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:762:13)</span>\n<span class=\"stack internal\">at ssrRenderSlotInner (./node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:113:17)</span>\n<span class=\"stack internal\">at Module.ssrRenderSlot (./node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:95:3)</span></pre>"
}
I'm getting a "Warning: Invalid token" when attempting to extract a template from a Directus docker installation on a local environment. I've verified that the static access token I've provided is correct using Postman.
The Directus instance I have set up is accessible on my local machine at http://localhost:7055/. I'm running the Template CLI using the Docker Desktop Exec interface. This is a preview of the inputs I gave:
What is your Directus URL?: localhost:7055
What is your Directus Admin Token?: <directus admin static access token here>
› Warning: Invalid token
Hi Dev's,
I am using local Directus instance. Directus is working fine on start but while implementing AgencyOS with "npx directus-template-cli@latest apply" I am getting error.
Error: Cannot find module 'C:\Users\Admin\AppData\Local\npm-cache_npx\623fa71c079d6ec8\node_modules\braces\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:444:19)
at Module._findPath (node:internal/modules/cjs/loader:715:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (C:\Users\Admin\AppData\Local\npm-cache_npx\623fa71c079d6ec8\node_modules@oclif\core\node_modules\micromatch\index.js:4:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\Users\Admin\AppData\Local\npm-cache\_npx\623fa71c079d6ec8\node_modules\braces\package.json',
requestPath: 'braces'
}
I google it but didn't get any solution, Let me know if anyone knows the solution.
When attempting to apply an official template using directus-template-cli
, the process fails with a TypeError. This error occurs regardless of the version used (tested with 0.4.0, 0.4.1, 0.3.6, and '@latest'). The expected behavior is for the template application process to complete successfully without errors.
Error encountered:
Loading 46 files... !
TypeError: Cannot read properties of undefined (reading 'status')
npx [email protected] apply
.The template application process should be completed successfully, allowing the "Headless CMS - Website" template to be applied to the Directus project.
The process fails with a TypeError related to an undefined property 'status', preventing the successful application of the template.
N/A
directus-template-cli
, including 0.4.0, 0.4.1, 0.3.6, and '@latest'.The issue occurs consistently when following the steps to reproduce with the mentioned versions of directus-template-cli
.
Hi guys I try to follow the guides to install the cli but something is wrong.
If run this:
npx directus-template-cli@latest apply
This is the log
`root@jose-System:~# sudo npx directus-template-cli@latest apply
Need to install the following packages:
directus-template-cli@latest
Ok to proceed? (y) y
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=18.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@directus/[email protected]',
npm WARN EBADENGINE required: { node: '>=18.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@oclif/[email protected]',
npm WARN EBADENGINE required: { node: '>=18.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@oclif/[email protected]',
npm WARN EBADENGINE required: { node: '>=18.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@oclif/[email protected]',
npm WARN EBADENGINE required: { node: '>=18.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>= 18' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16 || 14 >=14.17' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^14.18.0 || >=16.10.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '^14.16.0 || >=16.10.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16.17' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=16.17.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=14' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'node:url'
Require stack:
Hi,
Im getiing an error when extracting a template form our staging project:
Logged in as Admin User
------------------
Extracted schema snapshot
Extracted collections
Extracted fields
Extracted relations
Extracted folders
Extracted files
Extracted users
Extracted roles
Extracted permissions
Extracted presets
Extracted translations
Extracted flows
Extracted operations
Extracted dashboards
Extracted panels
Extracted settings
Extracted items from collection: config_endpoints
Extracted items from collection: config_endpoints_directus_roles
Extracted items from collection: config_endpoints_directus_users
Extracted items from collection: parking_areas
Extracted items from collection: parking_blocks
Extracted items from collection: parking_destinations
Extracted items from collection: parking_logs
Extracted items from collection: parking_spots
Extracted items from collection: reservations
Extracted items from collection: rides_files_damage
Extracted items from collection: rides_files_mileage
Extracted items from collection: ride_gps_logs
Extracted items from collection: shifts
Extracted items from collection: rides
› Warning: Error downloading null
Extracting template - from [STAGING_URL] to [LOCAL_FOLDER]... !
TypeError: first argument must be a string or instance of Error
I followed the readme, running the tool locally with:
npx directus-template-cli@latest extract
Please let me know if more info is needed
For languages collection for example, PK is "code", well the content loader doesn't load any language provided, therefore the entirety of the app content isn't loaded because translations can't find related language entry.
I try to use the directus template cli on a locally installed Docker instance (URL: http://localhist:8066/). As far as I know, in order to install the tempalte cli, I first have to switch to Docker's internal shell like this:
docker exec -it directus-agency-tmpl-be-directus-1 sh
Then I can execute
npx directus-template-cli apply
which first downloads the cli and then starts the prompts.
Two problems happen:
docker exec -it ...
) and run npx directus-template-cli appy
, the cli is installed again. This happens every time when re-entering the shell and executing the npx command. I would expect that the project remembers that the cli was already downloaded. Why is this not the case?The whole process in the Docker shell:
Create new admin token
Apply new admin token
I am currently trying my hands on creating a more granular fetching and applying of data.
So far so good, it seems to be working as expected. There are some aspects that def. need to be done together ( i.E. flows&operation or permissions&roles.)
My question comes at the role of Schema and Collection. To me it seems like they should do the same thing. Update the Collection-Schema.
LoadData seems to some more (in regard to other collections too.) but then why also handle collections when they should be handled by the schema?
Should added some better error logging for third party use cases where extensive testing is not done. IE users extracting and applying their own templates that could potentially have different schemas, primary keys, etc.
Like #46 for instance.
Hello Bryant,
Have created a Directus instance on my local machine via Docker and customized it to my needs. Already added more than 100 records. Was very interested in your cli solution since I can import the assets and content together with the schema onto another Directus instance.
I've tried to apply the extracted data via the following command: npx directus-template-cli@latest apply
onto my server which support Docker too, using the cli, sh, from Portainer GUI. However, I'm getting the following errors:
{
message: "You don't have permission to access this.",
extensions: { code: 'FORBIDDEN' }
}
Getting the same error on all my collections.
Can you please advise...
Thanks in advance,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.