我一直从 npm 收到 errno 4058
I keep getting `errno 4058` from npm
过去几周我使用 npm 没有任何问题,但突然间我不断收到此错误:
npm ERR! path J:\Work\Web_server\create_file\node_modules\depd
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'J:\Work\Web_server\create_file\node_modules\depd' -> 'J:\Work\Web_server\create_file\node_modules\.depd.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\crist\AppData\Roaming\npm-cache\_logs18-08-13T09_21_56_509Z-debug.log
这是package.json
:
{
"name": "create_file",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies":{
},
"devDependencies":{
"express": "4.16.3"
}
}
问题是,当我手动安装软件包时也会发生这种情况。我究竟做错了什么?谢谢
编辑:当我在不同的目录上尝试时,手动安装成功了。我不知道为什么。
试试这个来解决你的错误
第 1 次通过此命令检查您的端口是否 运行ning
lsof -i :8080 // <- 无论你使用什么,这都是你的端口
端口是否持续 运行 如果它 运行 然后使用下面的命令
kill -9 14528 //你的进程Id
然后尝试 运行
节点index.js
我在 macOS 10.12.6、Node 8.3.0、NPM 5.3.0 上遇到了同样的错误。它经常但不总是指 .DELETE
。它总是报告 ENOENT: no such file or directory
没有其他节点进程 运行ning。我关闭了 Visual Studio 代码,仍然看到 ENOENT。
快速修复:
删除包-lock.json 并再次 运行 NPM
过去几周我使用 npm 没有任何问题,但突然间我不断收到此错误:
npm ERR! path J:\Work\Web_server\create_file\node_modules\depd
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'J:\Work\Web_server\create_file\node_modules\depd' -> 'J:\Work\Web_server\create_file\node_modules\.depd.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\crist\AppData\Roaming\npm-cache\_logs18-08-13T09_21_56_509Z-debug.log
这是package.json
:
{
"name": "create_file",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies":{
},
"devDependencies":{
"express": "4.16.3"
}
}
问题是,当我手动安装软件包时也会发生这种情况。我究竟做错了什么?谢谢
编辑:当我在不同的目录上尝试时,手动安装成功了。我不知道为什么。
试试这个来解决你的错误
第 1 次通过此命令检查您的端口是否 运行ning
lsof -i :8080 // <- 无论你使用什么,这都是你的端口
端口是否持续 运行 如果它 运行 然后使用下面的命令
kill -9 14528 //你的进程Id
然后尝试 运行
节点index.js
我在 macOS 10.12.6、Node 8.3.0、NPM 5.3.0 上遇到了同样的错误。它经常但不总是指 .DELETE
。它总是报告 ENOENT: no such file or directory
没有其他节点进程 运行ning。我关闭了 Visual Studio 代码,仍然看到 ENOENT。
快速修复: 删除包-lock.json 并再次 运行 NPM