首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在本地系统上安装角失败- npm错误!代码ERR_SOCKET_TIMEOUT

在本地系统上安装角失败- npm错误!代码ERR_SOCKET_TIMEOUT
EN

Stack Overflow用户
提问于 2021-12-14 11:10:32
回答 2查看 2K关注 0票数 2

我已经成功地在本地系统上安装了Node和AngularCLI。一切都很好。我有:

代码语言:javascript
复制
Angular CLI: 13.1.1
Node: 16.13.1
Package Manager: npm 8.1.2
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1301.1 (cli-only)
@angular-devkit/core         13.1.1 (cli-only)
@angular-devkit/schematics   13.1.1 (cli-only)
@schematics/angular          13.1.1 (cli-only)

但是,当我尝试使用ng新的myproject安装角项目时,我得到了以下错误:

代码语言:javascript
复制
- Installing packages (npm)...npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\BAMI\\Desktop\\MyApp\\APP-UI\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, unlink 'C:\Users\BAMI\Desktop\MyApp\APP-UI\node_modules\sass\sass.dart.js'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'unlink',
npm WARN cleanup       path: 'C:\\Users\\BAMI\\Desktop\\MyApp\\APP-UI\\node_modules\\sass\\sass.dart.js'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\BAMI\\Desktop\\MyApp\\APP-UI\\node_modules\\less',
npm WARN cleanup     [Error: EPERM: operation not permitted, unlink 'C:\Users\BAMI\Desktop\MyApp\APP-UI\node_modules\less\lib\less\environment\abstract-plugin-loader.js'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'unlink',
npm WARN cleanup       path: 'C:\\Users\\BAMI\\Desktop\\MyApp\\APP-UI\\node_modules\\less\\lib\\less\\environment\\abstract-plugin-loader.js'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
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缓存清晰-强制

问题仍然存在。

我该怎么解决这件事?

谢谢

EN

回答 2

Stack Overflow用户

发布于 2021-12-14 11:13:43

使用此命令全局更新npm

代码语言:javascript
复制
npm install -g npm
票数 2
EN

Stack Overflow用户

发布于 2021-12-14 11:17:24

检查以下步骤:

folder

  • reinstall
  • 测试你的连接,似乎
  • 也有问题--再一次核爆你的node_modules,你的npm,再一次
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70347903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档