node.js - 尝试安装节点包时遇到错误代码 ENOENT syscall rename errno -4058
问题描述
我一直在尝试安装几个总是导致 npm ERR 的节点包(图片附在下面)。我能够安装 express 包,但不能安装 mongoose、mongodb、@angular/cli,在安装过程中我遇到了这个错误。
以下是我的 node 和 npm 版本
下面是保存的错误日志。
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'E:\\Nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Nanda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli '@angular/cli'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.16.3
4 verbose npm-session aa9c7864071a84f9
.
.
.
75 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\Nanda\AppData\Roaming\npm-cache\_cacache\tmp\d74359a7' -> 'C:\Users\Nanda\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\1a\94\b0bf25ce70e3a557bd2f6e7ce38f87d6e715bf15d505ea7404b7510dcbb9b86427338b5fbf6ee5543c0aa619fab39ec391345cd432372d4c8a7c6bdb6e09'
76 verbose cwd C:\Users\Nanda
77 verbose Windows_NT 6.1.7601
78 verbose argv "E:\\Nodejs\\node.exe" "C:\\Users\\Nanda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
79 verbose node v12.16.3
80 verbose npm v6.14.5
81 error code ENOENT
82 error syscall rename
83 error path C:\Users\Nanda\AppData\Roaming\npm-cache\_cacache\tmp\d74359a7
84 error dest C:\Users\Nanda\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\1a\94\b0bf25ce70e3a557bd2f6e7ce38f87d6e715bf15d505ea7404b7510dcbb9b86427338b5fbf6ee5543c0aa619fab39ec391345cd432372d4c8a7c6bdb6e09
85 error errno -4058
86 error enoent ENOENT: no such file or directory, rename 'C:\Users\Nanda\AppData\Roaming\npm-cache\_cacache\tmp\d74359a7' -> 'C:\Users\Nanda\AppData\Roaming\npm-cache\_cacache\content-v2\sha512\1a\94\b0bf25ce70e3a557bd2f6e7ce38f87d6e715bf15d505ea7404b7510dcbb9b86427338b5fbf6ee5543c0aa619fab39ec391345cd432372d4c8a7c6bdb6e09'
87 error enoent This is related to npm not being able to find a file.
88 verbose exit [ -4058, true ]
注意:我使用的是 Windows 7、32 位系统
解决方案
我有一个类似的问题,并在 github 上找到了以下条目: https ://github.com/mapbox/node-sqlite3/issues/900
我刚刚删除了现有的 node_modules 并使用“npm install”再次安装了它
推荐阅读
- html - 如何让 html 格式显示在 JOptionPane 中?
- r - 如何在本网站自动提取数据?(看不到查询选项,如果有的话)
- javascript - 单击内部 div 时获取父 div id 名称
- java - JDK14-SpringBoot-Maven-Cassandra:“无法初始化类 org.codehaus.groovy.vmplugin.v7.Java7”异常仅具有 Cassandra 依赖项
- oauth-2.0 - 在 Microsoft OIDC 授权中跳过离线访问权限
- php - 找不到类“App\Libraries\QRcode” - 使用 CodeIgniter-PHP-QR-Code Codeigniter 4
- c# - 我用于 AES 加密 C# 的密钥大小错误
- java - hibernate 验证器抛出异常 ValidationException: HV000028 for @Past annotation
- python - Jinja2.exceptions.TemplateSyntaxError:遇到未知标签“信息”
- machine-learning - 使用 Pytorch 预测舞蹈帧