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

Generated package.json uses wrong version identifier #13367

Closed
charsleysa opened this issue Nov 24, 2022 · 2 comments · Fixed by #13692
Closed

Generated package.json uses wrong version identifier #13367

charsleysa opened this issue Nov 24, 2022 · 2 comments · Fixed by #13692
Assignees
Labels

Comments

@charsleysa
Copy link

charsleysa commented Nov 24, 2022

Current Behavior

Using anything that isn't a version number in the version field in the root package.json results in the generated package.json containing the wrong version number.

e.g. "postgres": "charsleysa/postgres#fix-errors-compiled", results in "postgres": "3.2.4", being generated

Expected Behavior

Generated package.json should keep the version identifier specified in package-lock.json dependencies.

e.g. "postgres": "git+ssh://git@github.com/charsleysa/postgres.git#3b1a01b2da3e2fafb1a79006f838eff11a8de3cb",

Github Repo

No response

Steps to Reproduce

Can be done with any package that doesn't use a version number

  1. Add "postgres": "charsleysa/postgres#fix-errors-compiled", to root package.json
  2. Run npm install
  3. Import postgres package into app configured to generate package.json
  4. Run build
  5. Generated package.json will now contain wrong version identifier

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 18.11.0
   OS   : linux x64
   npm  : 8.19.2
   
   nx : 15.2.1
   @nrwl/angular : Not Found
   @nrwl/cypress : Not Found
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.2.1
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.2.1
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.2.1
   @nrwl/js : 15.2.1
   @nrwl/linter : 15.2.1
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : 15.2.1
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : 15.2.1
   @nrwl/workspace : 15.2.1
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Failure Logs

No response

Additional Information

This was working fine in nx@15.0.0 so the bug appears to have been introduced when fixing another generated package.json issue, possibly by PR #12996

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Nov 24, 2022
@FrozenPandaz
Copy link
Collaborator

@meeroslav Can you take a look at this please?

@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 21, 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