AdminLTE icon indicating copy to clipboard operation
AdminLTE copied to clipboard

[BUG] Error: Cannot find module 'fs-extra'

Open develart-projects opened this issue 2 years ago • 6 comments

Describe the bug

Tried to install v3.2 using yarn install and always getting fs-extra not found. Including 2 different servers.

`error /usr/share/NetBeansProjects/FarebneObalky/devel/admin/public/static/components/admin-lte: Command failed. Exit code: 1 Command: npm run plugins Arguments: Directory: /usr/share/NetBeansProjects/FarebneObalky/devel/admin/public/static/components/admin-lte Output:

[email protected] plugins node build/npm/Publish.js -v

node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'fs-extra' Require stack:

  • /usr/share/NetBeansProjects/FarebneObalky/devel/admin/public/static/components/admin-lte/build/npm/Publish.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/usr/share/NetBeansProjects/FarebneObalky/devel/admin/public/static/components/admin-lte/build/npm/Publish.js:6:13) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) { code: 'MODULE_NOT_FOUND', requireStack: [ '/usr/share/NetBeansProjects/FarebneObalky/devel/admin/public/static/components/admin-lte/build/npm/Publish.js' ` I spent ages to google this and tons of different tries, no success.

Tried:

  • cleaning all caches
  • installing global fs-etra using npm
  • removing all the lock files, folders, etc.
  • tried different servers

..always ending up with this error. I think it's try to process ./Plugins folders, but that one is not present, because it's alredy moved or something like that.

To Reproduce Steps to reproduce the behavior:

  1. create package.json and include adminLte 3.2
  2. sett up .yarnrc to some different folder, like public/static/components/
  3. run yarn install
  4. install will fail, even if admin-lte is only package required

Expected behavior Plugins runs without errors.

Environment (please complete the following information):

  • AdminLTE Version: [e.g. v3.2]
  • Operating System: Fedora / Debian
  • Node: v16.14.0
  • Npm: 8.3.1
  • Yarn: 1.22.15

develart-projects avatar Aug 16 '22 22:08 develart-projects

Small investigation update:

Seems, that package is hardcoded to search for packages within node_modules folder, therefore when changing module folder, it fails.

I just verified that by backlinking public/static/components to node_modules in project root. This is definitely a bug.

develart-projects avatar Aug 17 '22 14:08 develart-projects

Sadly I not use yarn, can you give me a example .yarnrc file with the backlinking setup?

REJack avatar Aug 17 '22 16:08 REJack

Sure:

--modules-folder public/static/components/

develart-projects avatar Aug 17 '22 16:08 develart-projects

I need only put that in the .yarnrc? 😄

REJack avatar Aug 17 '22 16:08 REJack

Yep, thats all :)

Meantime I "fixed" it by symlink to the node_modules, but all points to the harcoded paths in Plugin script.

develart-projects avatar Aug 17 '22 16:08 develart-projects

I tested it and sadly I found no way to fix it 😞 I guess your workaround is the only option fornow, may someone knows better these options and can help 😄.

I hope this is not buggy with v4 too.

REJack avatar Aug 17 '22 17:08 REJack