在过去的几周里,我使用了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\_logs\2018-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"
}
}问题是,当我手动安装软件包时,也会发生这种情况。我做错了什么?谢谢
编辑:当我在一个不同的目录上尝试它时,手动安装起作用了。我不知道为什么。
发布于 2018-08-13 17:34:11
我在macOS 10.12.6,Node8.3.0,NPM 5.3.0上遇到了同样的错误。它经常但不总是指的是.DELETE。它总是报告ENOENT: no such file or directory
没有其他Node进程在运行。我关闭了Visual Studio代码,仍然看到了ENOENT。
QuickFix:删除包-lock.json并再次运行NPM
发布于 2018-08-13 17:33:39
尝试以下操作来解决您的错误
1通过此命令检查您的端口是否正在运行
lsof -i :8080 // <-这是您使用的端口
该端口是否连续运行如果它正在运行,请使用以下命令
kill -9 14528 //您的进程Id
然后试着跑一次
节点index.js
https://stackoverflow.com/questions/51819180
复制相似问题