Home > Blockchain >  Nest.js - process.env.npm_package_description does not return correct value
Nest.js - process.env.npm_package_description does not return correct value

Time:07-19

When running Nest.js application process.env.npm_package_description returns

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

instead of description that is in package.json

CodePudding user response:

So, I don't know the why yet, will update when I can find the code, but it looks like what is happening is that when the description in your package.json is empty then process.env.npm_package_description gets set to the first line (or close to it) of your README.

  • pnpm seems to not do this.
  • npm brings back a value like <p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a> </p>
  • yarn brings back a value of [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. (this is the first line under the ## Description tag in the README, might be related)
  • Related