每次我尝试在某个文件夹(前端大师课程的 GitHub 存储库)中安装查询器和指挥官时。每次尝试这样做时,我都会遇到这些错误。
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://artifactory.1and1.org/artifactory/api/npm/ciso-npm-virtual/yargs/-/yargs-11.1.0.tgz failed, reason: getaddrinfo ENOTFOUND artifactory.1and1.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/neeladri/.npm/_logs/2021-06-12T08_42_31_117Z-debug.log
奇怪的是我不使用任何代理并且有一个不错的互联网连接。我已经尝试了来自终端的连接,它们都工作得很好。还检查了与 registry.npmjs.org/ 的连接但是,当我尝试在目录之外执行这些操作时,一切似乎都很好。下面是 ~/.npmrc
;;;;
; npm userconfig file: /home/neeladri/.npmrc
; this is a simple ini-formatted file
; lines that start with semi-colons are comments
; run `npm help 7 config` for documentation of the various options
;
; Configs like `@scope:registry` map a scope to a given registry url.
;
; Configs like `//<hostname>/:_authToken` are auth that is restricted
; to the registry host specified.
//registry.npmjs.org/:_authToken=0c3edf13-f4f8-4c4c-82cc-190ee17156b9
registry=https://registry.npmjs.org/
;;;;
; all available options shown below with default values
;;;;
; _auth=null
; access=null
; all=false
; allow-same-version=false
; also=null
; audit=true
; audit-level=null
; auth-type=legacy
; before=null
; bin-links=true
; browser=null
; ca=null
; cache=~/.npm
; cache-max=null
; cache-min=0
; cafile=null
; call=
; cert=null
; ci-name=null
; cidr=null
; color=true
; commit-hooks=true
; depth=null
; description=true
; dev=false
;
; diff-ignore-all-space=false
; diff-name-only=false
; diff-no-prefix=false
; diff-dst-prefix=b/
; diff-src-prefix=a/
; diff-text=false
; diff-unified=3
; dry-run=false
; editor=vi
; engine-strict=false
; fetch-retries=2
; fetch-retry-factor=10
; fetch-retry-maxtimeout=60000
; fetch-retry-mintimeout=10000
; fetch-timeout=300000
; force=false
; foreground-scripts=false
; format-package-lock=true
; fund=true
; git=git
; git-tag-version=true
; global=false
; global-style=false
; globalconfig=
; heading=npm
; https-proxy=null
; if-present=false
; ignore-scripts=false
;
; include-staged=false
; init-author-email=
; init-author-name=
; init-author-url=
; init-license=ISC
; init-module=~/.npm-init.js
; init-version=1.0.0
; init.author.email=
; init.author.name=
; init.author.url=
; init.license=ISC
; init.module=~/.npm-init.js
; init.version=1.0.0
; json=false
; key=null
; legacy-bundling=false
; legacy-peer-deps=false
; link=false
; local-address=null
; loglevel=notice
; logs-max=10
; long=false
; maxsockets=15
; message=%s
; node-options=null
; node-version=v16.3.0
; noproxy=
; npm-version=7.15.1
; offline=false
;
; only=null
; optional=null
; otp=null
;
; package-lock=true
; package-lock-only=false
; parseable=false
; prefer-offline=false
; prefer-online=false
; prefix=
; preid=
; production=null
; progress=true
; proxy=null
; read-only=false
; rebuild-bundle=true
; registry=https://registry.npmjs.org/
; save=true
; save-bundle=false
; save-dev=false
; save-exact=false
; save-optional=false
; save-peer=false
; save-prefix=^
; save-prod=false
; scope=
; script-shell=null
; searchexclude=
; searchlimit=20
; searchopts=
; searchstaleness=900
; shell=/usr/bin/zsh
; shrinkwrap=true
; sign-git-commit=false
; sign-git-tag=false
; sso-poll-frequency=500
; sso-type=oauth
; strict-peer-deps=false
; strict-ssl=true
; tag=latest
; tag-version-prefix=v
; timing=false
; tmp=/tmp
; umask=0
; unicode=true
; update-notifier=true
; usage=false
; user-agent=npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}
; userconfig=~/.npmrc
; version=false
; versions=false
; viewer=man
; which=null
;
; workspaces=false
; yes=null
我一直在尝试很多修复,例如删除更改注册表和内容的代理行,但似乎没有任何效果。此外,当我尝试在另一个项目的目录中做同样的事情时,这个没有 package-lock.json,我似乎得到了大约 40 个漏洞。我已经通过 nvm 安装了节点。