You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nx computing cache improved a lot our CI build times. Thanks for that 😍.
Now, the most of the build time is occupied by NPM dependencies installation and Ngcc build.
To solve this, we decided to cache the node_modules folder and create symbolic links onto builds with same dependencies.
However, the Nx cli cannot be run through linked node_modules currently as it uses __dirname to retrieve the local workspace.
Using process.cwd() instead of __dirname makes the cli work and the whole CI build success. By the way, maybe an environment variable or cli argument could do the job to precise the workspace path.
Expected Behavior
Run the nx.js binary from a symbolic linked node_modules directory.
Current Behavior
The workspace is not found because the use of __dirname which does not follow symbol links.
The command does not return anything because the workspace could not be found.
Context
Please provide any relevant information about your setup:
❯ nx report
> NX Report complete - copy this into the issue template
@nrwl/angular : 9.2.1
@nrwl/cli : 9.0.4
@nrwl/cypress : 9.2.1
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 9.2.1
@nrwl/linter : 9.2.1
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 9.2.1
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 9.0.4
@nrwl/web : Not Found
@nrwl/workspace : 9.2.1
typescript : 3.8.3
Thanks in advance
The text was updated successfully, but these errors were encountered:
We are having the exact issue. To speed up the build pipelines we wanted to cache docker image with node_modules pre-installed and share it among several CI jobs. And we've faced an issue that nx is not working with symbolic links, because of __dirname usage. __dirname returns the path where the actual node_modules are stored and nx is not able to find a workspace there.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
Nx computing cache improved a lot our CI build times. Thanks for that 😍.
Now, the most of the build time is occupied by NPM dependencies installation and Ngcc build.
To solve this, we decided to cache the node_modules folder and create symbolic links onto builds with same dependencies.
However, the Nx cli cannot be run through linked
node_modules
currently as it uses __dirname to retrieve the local workspace.Using
process.cwd()
instead of__dirname
makes the cli work and the whole CI build success. By the way, maybe an environment variable or cli argument could do the job to precise the workspace path.Expected Behavior
Run the nx.js binary from a symbolic linked node_modules directory.
Current Behavior
The workspace is not found because the use of
__dirname
which does not follow symbol links.Steps to Reproduce
The command does not return anything because the workspace could not be found.
Context
Please provide any relevant information about your setup:
Thanks in advance
The text was updated successfully, but these errors were encountered: