首页 > 解决方案 > 尝试安装节点包时遇到错误代码 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 位系统

标签: node.jsnpmangular-clinode-modulesnpm-install

解决方案


我有一个类似的问题,并在 github 上找到了以下条目: https ://github.com/mapbox/node-sqlite3/issues/900

我刚刚删除了现有的 node_modules 并使用“npm install”再次安装了它


推荐阅读