目录

What should I do if error 404 is reported during installation of the Axios library?

Symptom

During installation of the Axios library, error 404 is reported when the npm install @ohos/axios --save command is run.

Solution

Error 404 indicates that the corresponding resource file cannot be found. The mirrored environment or ohpm proxy may be incorrectly configured.

  1. Open the terminal command window in DevEco Studio.
  2. Run the following command to set the npm registry:

    ohpm config set registry https://repo.harmonyos.com/ohpm/

  3. Run the following command to install the Axios library:

    ohpm install @ohos/axios

For details about how to configure the ohpm proxy, see Setting Up the ohpm Proxy.