Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Node.js process.cwd() "no such file or directory" Starting HTTP-Server

DZone's Guide to

Node.js process.cwd() "no such file or directory" Starting HTTP-Server

Learn how to resolve a "no such file or directory" error in node.js with this simple, effective code snippet.

· DevOps Zone ·
Free Resource

Read why times series is the fastest growing database category.

When starting the node.js http-server, I got this error:

Error: ENOENT, no such file or directory
at Error (native)
at Function.startup.resolveArgv0 (node.js:720:23)
at startup (node.js:63:13)
at node.js:814:3

From the post here, it seems this error can occur if you attempt to start the server in a dir that’s already been deleted. In my case I had renamed a folder that contained the folder where I was attempting to start the server. cd’d up a couple and into the new/renamed folder, and problem solved.

 

Learn how to get 20x more performance than Elastic by moving to a Time Series database.

Topics:
devops ,javascript ,node.js ,http

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}