【问题标题】:Getting errors with npm when installing nativescript安装 nativescript 时出现 npm 错误
【发布时间】:2016-08-16 14:26:46
【问题描述】:

我正在尝试安装 nativescript,我是新手,所以我将不胜感激。 首先,我正确安装了它,但之后我在 nativescript 网站上看到了一个用于高级安装的页面,所以我玩弄了它..现在我无法运行命令 tns 并且无法卸载,无法安装.. 这是我得到的错误:

注意:我也将我的 nodejs 更新到了最新版本,但是当我尝试运行时无法更新 npm:npm install npm -g 我得到了如下错误:

我也试过重启电脑,但没有帮助。

我卸载了节点,npm 然后再次安装它们.. 现在我收到此错误:

             ERR! network getaddrinfo ENOTFOUND registry.npmjs.org      registry.npmjs.org:443
         ERR! network This is most likely not a problem with npm itself
         ERR! network and is related to network connectivity.
         ERR! network In most cases you are behind a proxy or have bad network settings.
         ERR! network
         ERR! network If you are behind a proxy, please make sure that the
         ERR! network 'proxy' config is set properly.  See: 'npm help config'

         ERR! Please include the following file with any support request:
         ERR!     C:\Users\Home\npm-debug.log

【问题讨论】:

  • 在您尝试卸载 lnativescript 的第一个屏幕上...在最后一个屏幕上您正在运行错误的命令 - 您应该运行:npm install -g nativescript(而不是 npm install npm)

标签: node.js npm nativescript


【解决方案1】:

这是一个连接问题。

我记得我像这样错误地使用代理配置:

   npm config set proxy http://localhost:8080/
   npm config set https-proxy http://localhost:8080/
   npm config set strict-ssl false

这使得 npm 客户端尝试访问 localhost:8080 来拉取模块,而不是正确的 Internet 端点。

所以经过几天的挫折后,我访问了这个链接

https://docs.npmjs.com/cli/config

然后运行

npm config edit

在该文件中打开了一个文件,我删除了我在上面添加的那三行,然后一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-12
    • 2015-04-27
    • 1970-01-01
    • 2021-05-26
    • 2015-08-21
    • 2021-03-15
    • 2023-03-29
    • 1970-01-01
    相关资源
    最近更新 更多