Closed mwoodpatrick closed 2 years ago
This seems to be a yarn version issue with having yarn 3 set in my env even though I have a yarnrc.yml with:
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-1.23.0-20211217.1235.cjs
It would be great if nx supported yarn3
Running the same project in a different wsl distribution which has yarn 1 as the default fixed the above issue.
Adding the complex project with a dependency on simple. Looks like I need to add version numbers to simple & complex packages for workspaces to pick these up and link them into node_modules otherwise yarn reports:
warning Missing version in workspace at "/mnt/wsl/projects/git/www/my-payload/packages/complex", ignoring.
warning Missing version in workspace at "/mnt/wsl/projects/git/www/my-payload/packages/simple", ignoring.
I did not see where in the guide it discusses this.
Adding the version numbers, then running yarn (not mentioned) fixes the problem (by linking the packages into node_modules and then
npx nx test complex
runs.
However, running:
npx nx dep-graph
Does not show the dependency of complex on simple even though its identified in the package.json and index.js
running
npx nx run-many --target --test --all --parallel=5
as described in the guide fails for me with:
Not enough arguments following: target
However, running:
npx nx run-many --target=test --all --parallel=5
Does run the tests
The same is true for:
npx nx affected --target --test --all
Changing this to:
npx nx affected --target=test --all
The test runs as expectedf
Doing:
yarn add -W -D @nrwl/node
npx nx g @nrwl/node:application my-node-app
Puts the node app my-node-app under packages rather than apps which is what I had expected!
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
I'm trying to follow the guide:
Nx and Yarn/Lerna (Workspaces for Publishing NPM Packages)
Current Behavior
I was able to create the simple project and install the projects dependencies but when I try to run:
npx nx test simple
I get:
If I cd into the packages/simple directory and run:
node
index.js`The test runs normally and displays:
Hello World
Expected Behavior
Running the above nx command should run node and display the expected output
Steps to Reproduce
Not sure AFAIK I'm Just following the setup in the guide, any suggestions on how I can debug what I've done wrong would be appreciated.
I have a public repo of my code here:
https://github.com/mwoodpatrick/my-payload
Failure Logs
No logs generated
Environment
The only special item of notice is that I'm running on WSL-2 but I have other nx projects running in same environment without issue.
Node : 16.13.1 OS : linux x65 yarn : 3.1.1
nx : 13.3.9 @nrwl/angular : undefined @nrwl/cli : 13.3.9 @nrwl/cypress : undefined @nrwl/devkit : 13.3.9 @nrwl/eslint-plugin-nx : undefined @nrwl/express : undefined @nrwl/jest : 13.3.9 @nrwl/linter : 13.3.9 @nrwl/nest : undefined @nrwl/next : undefined @nrwl/node : undefined @nrwl/nx-cloud : undefined @nrwl/react : undefined @nrwl/react-native : undefined @nrwl/schematics : undefined @nrwl/tao : 13.3.9 @nrwl/web : undefined @nrwl/workspace : 13.3.9 @nrwl/storybook : undefined @nrwl/gatsby : undefined typescript : 4.4.4 rxjs : 6.6.7
Community plugins: