smapiot / piral

🚀 Framework for next generation web apps using micro frontends. ⭐️ Star to support our work!
https://piral.io
MIT License
1.71k stars 127 forks source link

Piral-cli throws exception #624

Closed eugen-meissner closed 1 year ago

eugen-meissner commented 1 year ago

Bug Report

Running the piral command after fresh global install using pnpm throws this error:

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOENT: no such file or directory, stat '/home/em/Dev/node_modules'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/home/em/Dev/node_modules'
}

Node.js v19.7.0

Steps to reproduce

Do a fresh install of the piral-cli with pnpm i piral-cli -g and then run piral in a directory that does not include a node_modules directory

System

OS: Manjaro Linux Kernel Version 5.1.51-1-MANJARO Node Version: 19.7.0 Pnpm Version: 8.1.0

FlorianRappl commented 1 year ago

Is it global installation only? Not sure that works with pnpm and not sure if we can make this work as its quite different to npm / yarn.

Any reason for using the global installation? We usually recommend avoiding the global installation as global installations are generally considered bad practice. The only use case we can think of is for scaffolding, but here solutions such as npm initializers might anyway be better.

eugen-meissner commented 1 year ago

I went with the global install because that's what the documentation said, even though there was a disclaimer about it maybe not being the best idea.

I tried it anyway and saw this error pop up so I wanted to give you a heads up. If global installs aren't the way to use the cli and you don't plan on supporting it, especially with pnpm, then no worries—feel free to close the issue.

Cheers

FlorianRappl commented 1 year ago

Well, ideally I'd like to support it, but I think it will be difficult due to the differences... I'll keep this open and either make it a documentation item or solve it - either way it should "work" as documented.

FlorianRappl commented 1 year ago

Actually it was just a minor thing and it could actually also impact other package managers, even though (in case of npm) that is very unlikely. Thanks for bringing this up - is part of the next release.

eugen-meissner commented 1 year ago

Nice, thank you!