0

I would like to get the version of my angular application via terminal.

$ npm version
{'lib-workspace': '0.0.0',
  npm: '7.20.3',
  node: '14.17.3',
  v8: '8.4.371.23-node.67',
  uv: '1.41.0',
  zlib: '1.2.11',
  brotli: '1.0.9'}

But I would like to get only the version of 'lib-workspace' ->

0.0.0
Marek Vondra
  • 59
  • 1
  • 9
  • From `npm help version`: `npm view version` to view a package's published version. So `npm view 'lib-workspace' version` – Heretic Monkey Oct 25 '21 at 14:39
  • Please [edit] your question to show how you implemented the answers to the question pointed out by @Roy and how the failed to give you the answer to your question. Note that there are 30 answers to that question... – Heretic Monkey Oct 25 '21 at 15:44
  • Thank you for suggestions. Both is not unfortunately possible. I need get really clean version 0.0.0. From this string I create release (GitHub actions). npm view 'lib-workspace' version It is not the right because lib-workspace is not published – Marek Vondra Oct 25 '21 at 16:43
  • My question is not the same as in link. I want to give only this version string without the label. – Marek Vondra Oct 26 '21 at 08:49
  • Again, you have not tried the answers. [This answer, for instance, gives **exactly** the response you're looking for](https://stackoverflow.com/a/39790997/215552). Running `node -p "require('./package.json').version"` will return `0.0.0`. If it doesn't, [edit] your question showing the contents of your package.json file and the result of that call. – Heretic Monkey Oct 26 '21 at 11:45

0 Answers0