pnpm install fomantic-ui fails
Bug Reportm
Steps to reproduce
-
pnpm init -y -
pnpm install fomantic-ui
Expected result
fomantic-ui installed without error
Actual result
.../node_modules/fomantic-ui install$ gulp install
│ [14:32:44] Using gulpfile ~/work/examples/test/node_modules/.pnpm/[email protected]/node_modules/fomantic-ui/gulpfile.js
│ [14:32:44] Starting 'install'...
│ SUI is a sub-module, skipping end-user install
│ [14:32:44] The following tasks did not complete: install
│ [14:32:44] Did you forget to signal async completion?
└─ Failed in 1.3s
ERROR Command failed with exit code 1.
Testcase
Screenshot (if possible)
Version
2.8.7
Please try pnpx gulp build instead of gulp install..otherwise pnpm as well as yarn or node 15+ is not officially supported and needs somebody to help the project with a proper PR
fomantic-ui's install script tries some "magic" with searching the directory tree (check if it is subdependency, a.s.o.), which does not really work with the symlinks, pnpm is using. This can be seen from the error message
node_modules/.pnpm/[email protected]/node_modules/fomantic-ui: Running install script, failed in 1.7s
while it normally would be located in
node_modules/fomantic-ui
which however, is a symlink to the former.
Maybe, the install script could change behaviour depending on environment
npm_execpath: '...\\node_modules\\pnpm\\bin\\pnpm.cjs',
or if __dirname contains node_modules/.pnpm - package.json as well as semantic.json should be siblings to this node_modules and files could be copied there from __dirname according to config in semantic.json.
This would be for updates only - interactive configuration will not work of course.
Anyway, in general I don't think it's a great idea to be that directory tree dependent: https://yarnpkg.com/advanced/rulebook#modules-shouldnt-hardcode-node_modules-paths-to-access-other-modules
Fixed bx #2280