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

Learn more about how CareerBuilder was able to resolve customer issues 5x faster by using Scalyr, the fastest log management tool on the market. 

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.

 

Find out more about how Scalyr built a proprietary database that does not use text indexing for their log management tool.

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 }}