Editing the HTML file makes a "localhost refused to connect" error after running "npm-start"

25 views Asked by At

I'm a beginner building a frontend-based website using Visual Studio Code and parcel from the NPM.

When I use "npm start" command - first everything works fine: editing the javascript and css files doesn't make any issues. But when I edit the html files the browser crashes and shows error:

"This site can’t be reached, localhost refused to connect". (http://localhost:1234/html/cart.html)

⠙ Packaging html\cart.html...
node:fs:1878
  binding.unlink(path);
          ^

Error: ENOENT: no such file or directory, unlink 'C:\Users\aaaaa\Desktop\aaaaaa\dist\html\cart.html.20336.36'
    at Object.unlinkSync (node:fs:1878:11)
    at WriteStream.<anonymous> (C:\Users\aaaaa\Desktop\aaaaaaa\node_modules\@parcel\fs\lib\index.js:1024:83)
    at Object.onceWrapper (node:events:633:26)
    at WriteStream.emit (node:events:530:35)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'unlink',
  path: 'C:\\Users\\aaaaa\\Desktop\aaaaaa\\dist\\html\\cart.html.20336.36'
}

Node.js v20.11.1

I tried many solution from the web:

  • Clearing browser history, cahce, cookies, data
  • Trying another browser
  • Updating google chrome
  • Reinstalling node js
  • Downloading the project to another computer and running it from there
  • Checking that the port is not busy
  • Changing the port number
  • Checking it's not block by windows firewall
  • Manually adding a rule in windows firewall for the specific rule

Still have the same issue.

0

There are 0 answers