nx icon indicating copy to clipboard operation
nx copied to clipboard

Allow `cwd` as an option in `nx serve`

Open charlie-nik opened this issue 3 years ago • 0 comments

When running a node application using nx serve, the process.env() always refers to the root directory as opposed to the application directory. As a result, it's not able to locate certain files correctly.

Unfortunately, due to the way my project is set up, there's no way to hack through it. Would it be possible to include cwd as an option in the @nrwl/node:node executor?

Description

Unable to control process.cwd() which always points to the root directory.

Solution

Allow cwd as an option in nx serve, specifically in the @nrwl/node:node executor.

Thanks a lot!

Originally posted by @charlie-nik in https://github.com/nrwl/nx/issues/1194#issuecomment-1205436544

charlie-nik avatar Aug 04 '22 15:08 charlie-nik