Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nx doesn't do correct node resolution #3909

Closed
mhamri opened this issue Oct 13, 2020 · 6 comments · Fixed by #3998
Closed

nx doesn't do correct node resolution #3909

mhamri opened this issue Oct 13, 2020 · 6 comments · Fixed by #3998
Labels

Comments

@mhamri
Copy link

mhamri commented Oct 13, 2020

angular/angular-cli#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

> [email protected] 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
@vsavkin vsavkin added the scope: core core nx functionality label Oct 23, 2020
@vsavkin
Copy link
Member

vsavkin commented Oct 23, 2020

@bekos do you think your work on yarn2 addressed this?

@bekos
Copy link
Contributor

bekos commented Oct 24, 2020

Yes, it should. @mhamri from the error message you get, it seems that you are using an older version of Nx. Can you update your global packages to latest and try again?

@mhamri
Copy link
Author

mhamri commented Oct 26, 2020

@bekos let me try, I will update in here

@mhamri
Copy link
Author

mhamri commented Oct 27, 2020

@bekos it exits without any error

image

in the picture, i'm in /home/node/app where the node_modules is in /home/node (I did ls and pwd to give you an idea about hte structure)

then if I go to app folder and run npm start which translate to nx serve then it does nothing.

just note that I don't have node install globally. so meaning the npm is being read from the /home/node/node_modules

@bekos
Copy link
Contributor

bekos commented Oct 30, 2020

@mhamri seems like it cannot locate the workspace directory, and probably related to #3484 which is more complicated. I will try to take a stub on this and let you know.

bekos added a commit to bekos/nx that referenced this issue Oct 30, 2020
bekos added a commit to bekos/nx that referenced this issue Oct 30, 2020
bekos added a commit to bekos/nx that referenced this issue Oct 30, 2020
vsavkin pushed a commit that referenced this issue Nov 1, 2020
tinesoft pushed a commit to tinesoft/nx that referenced this issue Nov 1, 2020
Doginal pushed a commit to Doginal/nx that referenced this issue Nov 25, 2020
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants