-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaffolding a Piral Instance Fails in Windows #192
Comments
As a follow up https://docs.piral.io/ seems to say that you should instead use |
So both things should work - and the tutorial is not outdated even though we recommend using I've just tried this in WSL and for me this worked. What version of the
Maybe this is OS related. I'll try in plain Windows later! Thanks for the report. I'll keep investigating. |
Specifically, I was following https://docs.piral.io/tutorials/02-getting-started , so I should have @latest tag of piral-cli, which is [email protected] |
Looks like this is windows only, ran in WSL (Ubuntu) and the scaffold worked just fine. |
Thanks for confirming. Will be fixed asap! |
So far I'm unable to reproduce this on my Windows machine. I could find another bug with the verbose logging filename of Parcel's logger on Windows, which will be fixed. I used:
Executed the scaffolding in PowerShell. |
I did some more tries and it's working for me when I use PowerShell directly, but it fails when I run it from the Visual Studio Code integrated PowerShell. PS C:\tmp\piral> piral new --target app-shell
- Preparing source and target ...null
Codes Reference: https://docs.piral.io/code/search It created the |
Hm I just tried running from VS Code. Seems to be working so far. I'll try a few variations. Mind sharing the Node / NPM version? Thanks! |
PS C:\tmp> node --version
v12.16.1
PS C:\tmp> npm --version
6.14.4
PS C:\tmp> code --version
1.43.2
0ba0ca52957102ca3527cf479571617f0de6ed50
x64
PS C:\tmp> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.628
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.628
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1 |
I also updated my Node / NPM versions to match this. No success so far - it always works. |
I did some quick debugging and it seems like the promise in
though it doesn't really give any hints why the install failed... |
I guess it may be due to the way the options are provided. But then not sure why it works in one PS and not in the other. I would expect some issue, e.g., with CMD. Definitely interesting ... Thanks for the investigation so far! 🍻 |
I'm running in node v10.14.2 and npm 6.4.1 for more info. |
Still having trouble to reproduce. For me - no matter the Node and NPM version - it works. It works in PowerShell, works in PS of VS Code (Windows) and also works in plain CMD. I have a feeling that the problem lies in this part export function runScript(script: string, cwd = process.cwd(), output: NodeJS.WritableStream = process.stdout) {
const bin = resolve('./node_modules/.bin');
const sep = isWindows ? ';' : ':';
const env = Object.assign({}, process.env);
env.PATH = `${bin}${sep}${env.PATH}`;
log('generalDebug_0003', `Running "${script}" in "${cwd}" ("${bin}").`);
return new Promise<void>((resolve, reject) => {
const error = new MemoryStream();
const opt = { end: false };
const cp = exec(script, {
cwd,
env,
});
cp.stdout.pipe(output, opt);
cp.stderr.pipe(error, opt);
cp.on('error', () => reject(new Error(error.value)));
cp.on('close', (code, signal) => (code === 0 ? resolve() : reject(new Error(signal))));
});
} but I don't know which part could be responsible. I will actually defer this issue to 0.11.3 - and I hope that in the meantime it can be reproduced. Thanks for the infos and efforts so far @MattShrider @axinom-benjamin ! |
PS C:\Projects\PiralTest> npx piral-cli@next new --target app-shell
- Preparing source and target ...Der Befehl "where.exe" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Codes Reference: https://docs.piral.io/code/search
PS C:\Projects\PiralTest> npx piral-cli@next new --version
0.11.6-pre.1372 still the same |
Hm something does not seem right. The latest |
that's strange indeed... and when installing PS C:\Projects\PiralTest> piral new --target app-shell
- Preparing source and target ...Der Befehl "npm.cmd" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Codes Reference: https://docs.piral.io/code/search
PS C:\Projects\PiralTest> piral --version
0.11.6-pre.1372 |
Understood. Thanks for the investigation @axinom-benjamin ! One more try please (...). Thanks! |
PS C:\Projects\PiralTest> npx piral-cli@next --version
0.11.6-pre.1380
PS C:\Projects\PiralTest> npx piral-cli@next new --target app-shell
- Preparing source and target ...Der Befehl "npm.cmd" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Codes Reference: https://docs.piral.io/code/search 😟 |
Since we cannot reproduce it I would suggest to try We'd now defer that back to an unknown point in time. Its not a critical issue and it seems to be difficult / very special to reproduce. At least we have not managed to see it on our Windows machines. Once a solid path for reproduction is known we can look into this again. |
still the same after But I agree that this issue is not worth hunting further. It sees not really wide-spread and most likely some strange configuration that is happening on my machine. Since there are also very feasible workarounds, so it's not a critical issue at all. The workarounds (that work on my machine) for the protocol:
The only thing that doesn't work is: running it using npx from inside the integrated terminal in VS Code. Still, thanks for all the time spent trying to find the issue! |
I get the same issue when using Powershell inside VS Code on my dev machine at work. But it's not an issue for me because I don't use it there. |
Tried in VS Code on my Windows host. I tried I am therefore unsure to proceed. I'd love to close (fix) this, but without having a reproducible on my machine it will be difficult. I am quite sure its something about the ENV, but I don't know what. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Our organization has just started looking into piral as an alternative microfrontend framework. We encountered a possibly-related issue where, in some environments, the Tracked it down to a Windows environment where nodejs is not installed in the standard location because it was installed as non-administrator. In this case, As discovered in #192 (comment), the Fixed it in
I'd like to initiate a PR, but I get failures on the latest develop branch on building |
Yeah just do the PR (much appreciated!) - we can handle the build failure separately! |
(I also need to point out that we need to be careful here. |
@FlorianRappl Thanks for pointing that out, and I had to rework my fix. Spawning a child process still looks for the |
Bug Report
For more information, see the
CONTRIBUTING
guide.Prerequisites
Environment Details and Version
[email protected]
Windows
Description
Trying to follow the tutorial#1 getting started, says to run
piral new --target my-app
, following this fails to run. It gives me a blank folder with a package.json and nothing else.Steps to reproduce
Expected behavior
There should be a new piral instance there with the correct template
Actual behavior
The folder was empty and
piral debug
fails.Possible Origin / Solution
The tutorials may be out of date?
The text was updated successfully, but these errors were encountered: