OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Start-Process (pnpm run build) This command cannot be run due to the error: %1 is not a valid Win32 application

  • Thread starter Thread starter rasilvap
  • Start date Start date
R

rasilvap

Guest
I have the next ps1 file created:

Code:
$Tool="pnpm"
 $ArgumentList="run", "build"
 $processResult = Start-Process `
        -FilePath $Tool `
        -ArgumentList $ArgumentList `
        -NoNewWindow `
        -PassThru `
        -Wait

If I try to run it on PowerShell such as: .\example.ps1

I got the next error message:

Code:
Start-Process: C:\data\example.ps1:3
Line |
   3 |   $processResult = Start-Process `
     |                    ~~~~~~~~~~~~~~~
     | This command cannot be run due to the error: %1 is not a valid Win32 application.

But if I run the same file on a Mac PowerShell it runs successfully.

Besides that if I just change pnpm by npm it runs.

The next are my apps versions:

pnpm: 8.3.1 node:20.10.0 npm: 10.2.3 python: 3.12.4 powerShel: 7.4.3

Any ideas? Thanks!
<p>I have the next ps1 file created:</p>
<pre><code>$Tool="pnpm"
$ArgumentList="run", "build"
$processResult = Start-Process `
-FilePath $Tool `
-ArgumentList $ArgumentList `
-NoNewWindow `
-PassThru `
-Wait
</code></pre>
<p>If I try to run it on PowerShell such as: .\example.ps1</p>
<p>I got the next error message:</p>
<pre><code>Start-Process: C:\data\example.ps1:3
Line |
3 | $processResult = Start-Process `
| ~~~~~~~~~~~~~~~
| This command cannot be run due to the error: %1 is not a valid Win32 application.
</code></pre>
<p>But if I run the same file on a Mac PowerShell it runs successfully.</p>
<p>Besides that if I just change pnpm by npm it runs.</p>
<p>The next are my apps versions:</p>
<p>pnpm: 8.3.1
node:20.10.0
npm: 10.2.3
python: 3.12.4
powerShel: 7.4.3</p>
<p>Any ideas?
Thanks!</p>
Continue reading...
 

Latest posts

M
Replies
0
Views
1
Marcos R. Guevara
M
Top