Open baltpeter opened 1 year ago
As a workaround you can install like this: npm i appstraction --ignore-scripts
.
This will skip the postinstall
script and not preinstall the dependencies. But that isn't much of a problem. They are installed on demand anyway.
It seems like the error is caused by the semicolon being considered part of the path in Powershell. If I separate the semicolon from the path with a space, the postinstall
script runs.
Aha, apparently npm
on Windows doesn’t understand the semicolon at all and treats the second command as arguments of the first. Here is a minimal version to reproduce that:
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"postinstall": "echo 'first'; echo 'second'"
}
}
On Windows 10 PowerShell, we get:
PS C:\Users\user\Documents\test> npm run postinstall
> test@1.0.0 postinstall
> echo 'first'; echo 'second'
'first'; echo 'second'
While on a Fedora zsh this runs like expected:
❯ npm run postinstall
> test@1.0.0 postinstall
> echo 'first'; echo 'second'
first
second
It should be noted that this is not an issue with PowerShell, as this runs it just fine:
PS C:\Users\user\Documents\test> echo 'first'; echo 'second'
first
second
The problem is that the normal Windows cmd does not recognize ;
a a special character. Windows uses &
for that. &&
should work on both machines, though, so maybe let’s use that.
The examples for Android seem to run fine on Windows, after I fixed the install.
Error (this was when running
npm i -g tweasel-cli
):Full debug log: 2023-07-12T21_42_03_073Z-debug-0.log