directus-labs / directus-template-cli

Apply "templates" to a new, empty Directus project.
MIT License
88 stars 15 forks source link

Error: Cannot find module #43

Closed vishalchavda24 closed 6 months ago

vishalchavda24 commented 11 months ago

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.

Abdallah-Awwad commented 11 months ago

Hello there, hope you are doing fine.

Please refer to this.

Remove your node_modules folder and run npm i

Also, I suggest moving the project from the "C" partition, it may have some permissions limitation.

And let me know if you still ensuring the error.

vishalchavda24 commented 11 months ago

Hi I already tried that solution, Now I try on D drive on my system but facing same issue.

PS D:\Project Development\agencyos> npx directus-template-cli@latest apply node:internal/modules/cjs/loader:452 throw err; ^

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' }

Node.js v20.10.0

bryantgillespie commented 10 months ago

Moving this issue to directus-template-cli repo.