question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem testing simple package in repo

See original GitHub issue

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:

Usage Error: The project in /mnt/wsl/projects/git/www/my-payload/package.json doesn't seem to have been installed - running an install there might help

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

>  NX   ERROR  Running target "simple:test" failed

  Failed tasks:

  - simple:test

  Hint: run the command with --verbose for more details.

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.

NX Report complete - copy this into the issue template

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:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mwoodpatrickcommented, Dec 18, 2021

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

0reactions
mwoodpatrickcommented, Dec 18, 2021

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Mock to test package builds - Fedora Project Wiki
Mock takes a srpm and builds it in a chroot. This ensures that your BuildRequires lines are correct, that there are no missing...
Read more >
Testing your python package as installed - Paul Ganssle
The problem is that it makes it very easy to accidentally test your package as it exists in the repository rather than as...
Read more >
How to test Spring Data repositories? - Stack Overflow
The problem is that I am clueless as to how to write unit tests for such a repository. Let's take create() method for...
Read more >
Testing best practices - GitLab Docs
When implementing tests for a feature, we must think about developing the right tests, but then cover all the important ways the test...
Read more >
R Packages (2e) - 16 Advanced testing techniques
When the packages you depend on are updated, CRAN runs R CMD check on all reverse dependencies, including your package. If your package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found