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

Discover how quick and easy it is to secure secrets, so you can get back to doing what you love. Try Conjur, a free open source security service for developers.

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.

 

Conjur is a free open source security service built by DevOps engineers. With integrations with all your favorite tools and an easy way to secure secrets, it's a no brainer. Come check it out!

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