gpt4 book ai didi

node.js - npm install 失败并出现 404 错误(/@fortawesome%2fpro-regular-svg-icons - 未找到)尽管设置了标记

转载 作者:行者123 更新时间:2023-12-04 18:35:51 27 4
gpt4 key购买 nike

修复此 link 中未找到的私有(private)包的故障后.
我陷入了找不到错误“ Font Awesome ”库。以下是错误消息的详细信息:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@fortawesome%2fpro-regular-svg-icons - Not found
npm ERR! 404
npm ERR! 404 '@fortawesome/pro-regular-svg-icons@^5.15.2' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'data-qa-frontend'
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! /home/rando/.npm/_logs/2021-09-23T12_59_34_988Z-debug.log

如果我为 Font Awesome 注册表添加 auth_token,如下所示:
//registry.npmjs.com/:_authToken={TOKEN}
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken={TOKEN}
由于未找到私有(private)包而失败。在删除 font-awesome 注册表时,它会抛出 font-awesome library not found 的错误。
下面是部分 package.json 文件:
{
"name": "project-name",
"version": "0.1.0",
"private": true,
"dependencies": {
"@org/private-package": "^0.1.24",
"@fortawesome/fontawesome-pro": "^5.15.3",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/pro-duotone-svg-icons": "^5.15.2",
"@fortawesome/pro-light-svg-icons": "^5.15.2",
"@fortawesome/pro-regular-svg-icons": "^5.15.2",
"@fortawesome/pro-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
先感谢您。我将不胜感激解决此问题的任何帮助。

最佳答案

经过多次试验,
我按照以下步骤解决了这个问题:

  • 修改.npmrc文件内容如下:
  • @fortawesome:registry=https://npm.fontawesome.com/
    //npm.fontawesome.com/:_authToken={TOKEN}
  • 转到终端并登录到 npm,如下所示:
  • npm login
    Username:
    Password:
    Email: (this IS public) {may email}
    Logged in as {my username} on https://registry.npmjs.com/.
    在此之后检查 .npmrc file ,它应该如下所示:
    @fortawesome:registry=https://npm.fontawesome.com/
    //npm.fontawesome.com/:_authToken={TOKEN}
    //registry.npmjs.org/:_authToken=npm_{TOKEN}
  • 最后在项目根目录下运行 npm install 即可成功完成。
  • 关于node.js - npm install 失败并出现 404 错误(/@fortawesome%2fpro-regular-svg-icons - 未找到)尽管设置了标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69301035/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com