首页 > 解决方案 > 如何修复 npm/yeoman 安装错误:TypeError: cannot read property 'proxy' of undefined

问题描述

我目前正在尝试为我正在启动的 MEAN 堆栈项目安装 yeoman 生成器,但我不明白我在哪里搞砸了/是我还是机器错误。当安装过程达到健全性检查时,它会出现某种代理检测错误,因为它正在寻找不存在的文件夹中的代理。关于发生了什么的任何想法?

我已经正确设置了 npm 配置代理,并且我已经按照他们网站上的 yeoman 教程进行设置。

//I ran: npm install --global yo 
//cut to the part where it messed up, there's a lot here 
//'...' is where my userID is 

TypeError: Cannot read property 'proxy' of undefined
     at new OuterHttpAgent 
(C:\Users\...\AppData\Roaming\npm\node_modules\yo\node_modules\global- 
tunnel-ng\lib\agents.js:17:28)
 × yo version
 TypeError: Cannot read property 'proxy' of undefined
    at new OuterHttpAgent 
(C:\Users\...\AppData\Roaming\npm\node_modules\yo\node_modules\global- 
tunnel-ng\lib\agents.js:17:28)

文件路径在到达节点模块后不再有效(例如:文件夹中第一个不存在的文件是 \yo... )文件夹。我使用 Windows 文件资源管理器进入,但在此之下找不到任何内容。这是实际的 yeoman 代码中的一个问题,还是我需要更改某些内容才能正确生成文件?我在安装 express.js、oracledb 等其他插件时没有遇到任何问题,而且不久前我什至成功安装了 yeoman 并且没有遇到这个问题,所以我想知道可能会发生什么变化。

标签: windowsnpmyeomangit-bash

解决方案


推荐阅读