Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I keep getting `errno 4058` from npm

I used npm in the last weeks without any problems, but all of the sudden i keep getting this error:

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

This is the 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"
  }
}

The thing is, it also happens when I manually install a package. What am I doing wrong? Thanks

Edit: And when I tried it on a different directory the manual installation worked. I have no idea why.

like image 737
Ezeeroc Avatar asked Aug 13 '18 09:08

Ezeeroc


People also ask

How do I resolve npm start error?

To solve the npm ERR! Missing script: "start" error, make sure to add a start command to the scripts object in your package. json file and open your shell or IDE in the root directory of your project before running the npm start command.

Why npm install is giving error?

The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer.


2 Answers

I faced the same error on macOS 10.12.6, Node 8.3.0, NPM 5.3.0. It often, but not always is referring to .DELETE. It does always report ENOENT: no such file or directory

There are no other Node processes running. I closed Visual Studio Code, still seeing ENOENT.

QuickFix: Delete package-lock.json and run NPM again

like image 150
Sujeith Gopi Nath Avatar answered Oct 17 '22 08:10

Sujeith Gopi Nath


try this to solve your error

1st check your port is running or not through this command

lsof -i :8080 // <- this is your port whatever you used

the port is cotinuesly run or not if it run then use the below command

kill -9 14528 //your procee Id

then once try to run

node index.js

like image 28
Priyank Panchal Avatar answered Oct 17 '22 08:10

Priyank Panchal