Rahul Ganguly
Rahul Ganguly

Reputation: 2106

npm run build on windows 10 gives This app can't run on your PC

Trying to run the command npm run build on my system but keep getting this error. Tried uninstalling node but no luck. Any pointers would be helpful

enter image description here

Upvotes: 7

Views: 7978

Answers (4)

Thomas Ley
Thomas Ley

Reputation: 86

Better late than never: I had a problem with a corrupt node js package downloaded by nvm. So I did the following to solve the problem:

  1. Remove the broken node version in %appdata%\nvm
  2. Download the "zip installer" from node.js homepage
  3. Unzip the file and place the subfolder with the corresponding naming pattern in %appdata%\nvm

rename generic to version number

nvm is simply changing symbolic links to the correct node version. So make sure you have the same folder pattern and structure as for a working version and it works like charm.

Upvotes: 0

Gaetan vdb
Gaetan vdb

Reputation: 23

I was also using nvm. My problem was that the version was not properly being used.

Normally when running nvm list there is an asterisk (*) next to the current in-use version. But that was not the case (even after running nvm use x.x.x)

I installed a second node version and uninstalled the first one and reinstalled it. After that I could switch and run npm install.

Upvotes: 1

MrBoJangles
MrBoJangles

Reputation: 12237

The issue for me was that I am using nvm, and for reasons I don't yet know, when I try to set my node version to 12.14.0, and then run nvm list, no versions are selected. I went back to 13.8.0 and nvm list showed that 13.8.0 was selected.

Long story short, make sure you have a selected node version.

Upvotes: 5

mohammad javad ahmadi
mohammad javad ahmadi

Reputation: 2081

you should follow one of two option:

Option 1 – Setup by running the .msi installation file

  • Its a typical Windows installation and automated.
  • No need to add entries in environment varaiable

Option 2 – Setup by extracting .zip file

  • This method does not require admin access and can be used to install on nodejs on a system on which you dont have admin access such as you official laptop or desktop.
  • Removing nodejs is as simple as deleting the folder.
  • You will have to add entries in environment variable if you want to execute node command from any location in windows command prompt.

See the link below for more details : install Node.js and NPM on Windows 10

Upvotes: 0

Related Questions