简体   繁体   中英

Unsupported Platform error when running npm install

I am trying to run npm in a windows wsl/ubuntu environment. I tried to run npm install on a project I just cloned down from github and got this error back

npm ERR! notsup Unsupported platform for @next/swc-win32-x64-msvc@11.1.2: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})

Oddly, running npm -v gives 6.14.14 While which npm gives /home/steve/.nvm/versions/node/v14.17.4/bin/npm

Feels kind of like it's looking at two different versions? It probably shouldn't be trying to run a win32 package at all. Not sure how to remedy it though.

The library you're trying to install is declared as Windows-only as per the error message, but you're trying to install it on Linux (WSL count as Linux even though it's a "virtual" kernel). You should run it natively on Windows for it to succeed.

As for the versions, npm -v reports the npm version (6.14.14) while the version in the folder name of the path refers to the node version (14.17.4). Both are different normally, even though Npm always comes bundles with Node.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM