node.jsnpm.npmrcnpmrc

How do you add a comment to .npmrc?


My .npmrc looks like this:

node-options=--openssl-legacy-provider

I want it to look like this:

COMMENT the following line is needed for node 18 or higher
node-options=--openssl-legacy-provider

How do you add a comment in .npmrc?


Solution

  • Lines in .npmrc files are interpreted as comments when they begin with a ; or # character.

    https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#comments