JS component installation failed: While installing the JS sdk in DevEco studio

611 Views Asked by At

While installing the JS sdk in DevEco Studio, JS component installation failed with following error

enter image description here

How to solve above error?

2

There are 2 best solutions below

0
On

I also had an issue installing the JS SDK for DevEco Studio when I set the region as the United States during setup. It worked when I set the region to China.

2
On

Generally, the JS SDK download failure is caused by incorrect NPM proxy configuration or the npm cache. To fix this issue:

  1. If you're using a proxy for Internet access, configure an npm proxy server following instructions in Setting up the npm Proxy. If you have direct Internet access, skip this step.

  2. If Node.js has been installed or the npm environment variable has been set, open the command line tool and run the following command to clear the npm cache:

    npm cache clean -f

    If Node.js has not been installed, go to the tools\nodejs directory under the DevEco Studio installation directory and run the following command in the command line tool:

    .\npm cache clean -f

  3. On the welcome page, select Configure or click the Setting icon, and choose Settings > HarmonyOS SDK. Then select Js SDK and click Apply to re-download the SDK.

    enter image description here

For details, you could refer to this Docs.