Search code examples
node.jseslinteslint-config-airbnb

Getting error 404 while installing ESLint in Node JS


I'm trying to install ESLint and configuring it for a NodeJS project. When running npm init @eslint/config from command line, the following error appears:

PS C:\notes-app-backend> npm init @eslint/config
Need to install the following packages:
@eslint/[email protected]
Ok to proceed? (y) y
npm ERR! code E404
npm ERR! 404 Not Found - GET https://repo.huaweicloud.com/repository/npm/enquirer/-/enquirer-2.4.1.tgz
npm ERR! 404
npm ERR! 404  'enquirer@https://repo.huaweicloud.com/repository/npm/enquirer/-/enquirer-2.4.1.tgz' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\akhda\AppData\Local\npm-cache\_logs\2023-08-24T06_50_11_679Z-debug-0.log

Solution

  • [email protected] is currently missing from repo.huaweicloud.com.

    I guess you are not using npmjs.com because it's blocked in your region.

    Here are some options:

    1. Ask huaweicloud.com to re-sync their registry or at least this specific package version (I'm not familiar with the contacting process).
    2. Use an alternate registry. Maybe https://npmmirror.com an option?
    3. Use npmjs.com from an un-blocked machine, say a remote one. Run the installation once there and copy the project to your local development machine.

    If it's not blocked in your region and it was somehow set to huaweicloud.com (say by following an online guide whose author is from a "blocked" region), you can just reset npm registry to the npmjs.com one:

    npm config set registry https://registry.npmjs.org/