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.

nx doesn't do correct node resolution

See original GitHub issue

https://github.com/angular/angular-cli/issues/3864

it’s like Deja Vu, this issue just recently resolved in angular cli, now nx suffer from the same.

when node_module is in upper folder (mainly because of docker) the nx or any cli which is invoked by npm, should be able to traverse the folders and find the node_modules and use that folder as the node_module.

Current Behavior

/home/app # npm start -- playground

> revaedge@0.0.0 start /home/app
> nx serve "playground"


>  NX   ERROR  Could not find Nx in this workspace.

  To convert an Angular workspace to Nx run: ng add @nrwl/workspace

Expected Behavior

work like any other correct nodejs app. resolve to upper folder

Steps to Reproduce

move node_module to upper folder and try to run npm start.

Failure Logs

Environment

can’t because nx doesn’t work as it should

/home/app # npx nx report

>  NX   ERROR  Could not find Nx in this workspace.

  To convert an Angular workspace to Nx run: ng add @nrwl/workspace

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mhamricommented, Oct 26, 2020

@bekos let me try, I will update in here

0reactions
bekoscommented, Oct 30, 2020

@mhamri seems like it cannot locate the workspace directory, and probably related to https://github.com/nrwl/nx/issues/3484 which is more complicated. I will try to take a stub on this and let you know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Configuration - Nx
Projects can be configured in package.json (if you use npm scripts and not Nx executors) ... Nx merges the two files to get...
Read more >
Module not found: Can't resolve 'fs' in Next.js application
I deleted node_modules and package-lock.json and then npm cache clean and npm install...but still the same error appears. – Ibad Shaikh. Nov 20, ......
Read more >
Common errors - FAQ | NestJS - A progressive Node.js ...
Nest can't resolve dependencies of the <provider> (?). ... To fix that, make sure you're importing the class reference or use a custom...
Read more >
tsconfig-paths
js runtime resolution strategy of modules. But it also allows the use of path mapping which allows arbitrary module paths (that doesn't start ......
Read more >
nrwl-nx/community - Gitter
Hey again @kristofdegrave , it's saying Module not found: Error: Can't resolve '@namespace/lib-name-1' in '..../libs/lib-name-2/src/lib'.
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