Skip to content

[DOCS] <title> npm version help is missing --ignore-scripts option #8668

@jasonkarns

Description

@jasonkarns

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Enhancement, not another kind of Docs Enhancement.

  • This is a CLI Docs Enhancement.

Description of Problem

The docs for npm version are completely missing any reference to the --ignore-scripts option, which is important for being able to run npm version without preversion|version|postversion scripts running.

`npm version -h`

Bump a package version

Usage:
npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]

Options:
[--allow-same-version] [--no-commit-hooks] [--no-git-tag-version] [--json]
[--preid prerelease-id] [--sign-git-tag]
[-w|--workspace [-w|--workspace ...]]
[--workspaces] [--no-workspaces-update] [--include-workspace-root]

alias: verison

Run "npm help version" for more info

`npm help version`

NPM-VERSION(1)                                                  NPM-VERSION(1)

N�NA�AM�ME�E
n�np�pm�m-�-v�ve�er�rs�si�io�on�n - Bump a package version

S�Sy�yn�no�op�ps�si�is�s
npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]

     alias: verison

C�Co�on�nf�fi�ig�gu�ur�ra�at�ti�io�on�n
a�al�ll�lo�ow�w-�-s�sa�am�me�e-�-v�ve�er�rs�si�io�on�n

   •   Default: false

   •   Type: Boolean


   Prevents throwing an error when n�np�pm�m v�ve�er�rs�si�io�on�n is used to set the new
   version to the same value as the current version.

c�co�om�mm�mi�it�t-�-h�ho�oo�ok�ks�s

   •   Default: true

   •   Type: Boolean


   Run git commit hooks when using the n�np�pm�m v�ve�er�rs�si�io�on�n command.

g�gi�it�t-�-t�ta�ag�g-�-v�ve�er�rs�si�io�on�n

   •   Default: true

   •   Type: Boolean


   Tag the commit when using the n�np�pm�m v�ve�er�rs�si�io�on�n command. Setting this to
   false results in no commit being made at all.

j�js�so�on�n

   •   Default: false

   •   Type: Boolean


   Whether or not to output JSON data, rather than the normal output.

   •   In n�np�pm�m p�pk�kg�g s�se�et�t it enables parsing set values with JSON.parse()
       before saving them to your p�pa�ac�ck�ka�ag�ge�e.�.j�js�so�on�n.


   Not supported by all npm commands.

p�pr�re�ei�id�d

   •   Default: ""

   •   Type: String


   The "prerelease identifier" to use as a prefix for the "prerelease"
   part of a semver. Like the r�rc�c in 1�1.�.2�2.�.0�0-�-r�rc�c.�.8�8.

s�si�ig�gn�n-�-g�gi�it�t-�-t�ta�ag�g

   •   Default: false

   •   Type: Boolean


   If set to true, then the n�np�pm�m v�ve�er�rs�si�io�on�n command will tag the version using
   -�-s�s to add a signature.

   Note that git requires you to have set up GPG keys in your git configs
   for this to work properly.

w�wo�or�rk�ks�sp�pa�ac�ce�e

   •   Default:

   •   Type: String (can be set multiple times)


   Enable running a command in the context of the configured workspaces of
   the current project while filtering by running only the workspaces
   defined by this configuration option.

   Valid values for the w�wo�or�rk�ks�sp�pa�ac�ce�e config are either:

   •   Workspace names

   •   Path to a workspace directory

   •   Path to a parent workspace directory (will result in selecting all
       workspaces within that folder)


   When set for the n�np�pm�m i�in�ni�it�t command, this may be set to the folder of a
   workspace which does not yet exist, to create the folder and set it up
   as a brand new workspace within the project.

   This value is not exported to the environment for child processes.

w�wo�or�rk�ks�sp�pa�ac�ce�es�s

   •   Default: null

   •   Type: null or Boolean


   Set to true to run the command in the context of a�al�ll�l configured
   workspaces.

   Explicitly setting this to false will cause commands like i�in�ns�st�ta�al�ll�l to
   ignore workspaces altogether. When not set explicitly:

   •   Commands that operate on the n�no�od�de�e_�_m�mo�od�du�ul�le�es�s tree (install, update,
       etc.) will link workspaces into the n�no�od�de�e_�_m�mo�od�du�ul�le�es�s folder. - Commands
       that do other things (test, exec, publish, etc.) will operate on
       the root project, _�u_�n_�l_�e_�s_�s one or more workspaces are specified in
       the w�wo�or�rk�ks�sp�pa�ac�ce�e config.


   This value is not exported to the environment for child processes.

w�wo�or�rk�ks�sp�pa�ac�ce�es�s-�-u�up�pd�da�at�te�e

   •   Default: true

   •   Type: Boolean


   If set to true, the npm cli will run an update after operations that
   may possibly change the workspaces installed to the n�no�od�de�e_�_m�mo�od�du�ul�le�es�s
   folder.

i�in�nc�cl�lu�ud�de�e-�-w�wo�or�rk�ks�sp�pa�ac�ce�e-�-r�ro�oo�ot�t

   •   Default: false

   •   Type: Boolean


   Include the workspace root when workspaces are enabled for a command.

   When false, specifying individual workspaces via the w�wo�or�rk�ks�sp�pa�ac�ce�e config,
   or all workspaces via the w�wo�or�rk�ks�sp�pa�ac�ce�es�s flag, will cause npm to operate
   only on the specified workspaces, and not on the root project.

   This value is not exported to the environment for child processes.

D�De�es�sc�cr�ri�ip�pt�ti�io�on�n
Run this in a package directory to bump the version and write the new
data back to p�pa�ac�ck�ka�ag�ge�e.�.j�js�so�on�n, p�pa�ac�ck�ka�ag�ge�e-�-l�lo�oc�ck�k.�.j�js�so�on�n, and, if present, n�np�pm�m-�-
s�sh�hr�ri�in�nk�kw�wr�ra�ap�p.�.j�js�so�on�n.

   The n�ne�ew�wv�ve�er�rs�si�io�on�n argument should be a valid semver string, a valid second
   argument to s�se�em�mv�ve�er�r.�.i�in�nc�c _�⟨_�h_�t_�t_�p_�s_�:_�/_�/_�g_�i_�t_�h_�u_�b_�._�c_�o_�m_�/_�n_�p_�m_�/_�n_�o_�d_�e_�-_�s_�e_�m_�v_�e_�r_�#_�f_�u_�n_�c_�t_�i_�o_�n_�s_�⟩
   (one of p�pa�at�tc�ch�h, m�mi�in�no�or�r, m�ma�aj�jo�or�r, p�pr�re�ep�pa�at�tc�ch�h, p�pr�re�em�mi�in�no�or�r, p�pr�re�em�ma�aj�jo�or�r, p�pr�re�er�re�el�le�ea�as�se�e),
   or f�fr�ro�om�m-�-g�gi�it�t. In the second case, the existing version will be
   incremented by 1 in the specified field. f�fr�ro�om�m-�-g�gi�it�t will try to read the
   latest git tag, and use that as the new npm version.

   If run in a git repo, it will also create a version commit and tag.
   This behavior is controlled by g�gi�it�t-�-t�ta�ag�g-�-v�ve�er�rs�si�io�on�n (see below), and can be
   disabled on the command line by running n�np�pm�m -�--�-n�no�o-�-g�gi�it�t-�-t�ta�ag�g-�-v�ve�er�rs�si�io�on�n
   v�ve�er�rs�si�io�on�n. It will fail if the working directory is not clean, unless the
   -�-f�f or -�--�-f�fo�or�rc�ce�e flag is set.

   If supplied with -�-m�m or \�\f�fB�B-�--�-m�me�es�ss�sa�ag�ge�e\�\f�fR�R c�co�on�nf�fi�ig�g _�⟨_�/_�u_�s_�i_�n_�g_�-
   _�n_�p_�m_�/_�c_�o_�n_�f_�i_�g_�#_�m_�e_�s_�s_�a_�g_�e_�⟩ option, npm will use it as a commit message when
   creating a version commit. If the m�me�es�ss�sa�ag�ge�e config contains %�%s�s then that
   will be replaced with the resulting version number. For example:

     npm version patch -m "Upgrade to %s for reasons"

   If the \�\f�fB�Bs�si�ig�gn�n-�-g�gi�it�t-�-t�ta�ag�g\�\f�fR�R c�co�on�nf�fi�ig�g _�⟨_�/_�u_�s_�i_�n_�g_�-_�n_�p_�m_�/_�c_�o_�n_�f_�i_�g_�#_�s_�i_�g_�n_�-_�g_�i_�t_�-_�t_�a_�g_�⟩ is
   set, then the tag will be signed using the -�-s�s flag to git. Note that
   you must have a default GPG key set up in your git config for this to
   work properly. For example:

     $ npm config set sign-git-tag true
     $ npm version patch

     You need a passphrase to unlock the secret key for user: "isaacs (http://blog.izs.me/) <i@izs.me>"
     2048-bit RSA key, ID 6C481CF6, created 2010-08-31

     Enter passphrase:

   If p�pr�re�ev�ve�er�rs�si�io�on�n, v�ve�er�rs�si�io�on�n, or p�po�os�st�tv�ve�er�rs�si�io�on�n are in the s�sc�cr�ri�ip�pt�ts�s property of
   the package.json, they will be executed as part of running n�np�pm�m v�ve�er�rs�si�io�on�n.

   The exact order of execution is as follows:

   1.  Check to make sure the git working directory is clean before we get
       started. Your scripts may add files to the commit in future steps.
       This step is skipped if the -�--�-f�fo�or�rc�ce�e flag is set.

   2.  Run the p�pr�re�ev�ve�er�rs�si�io�on�n script. These scripts have access to the old
       v�ve�er�rs�si�io�on�n in package.json. A typical use would be running your full
       test suite before deploying. Any files you want added to the commit
       should be explicitly added using g�gi�it�t a�ad�dd�d.

   3.  Bump v�ve�er�rs�si�io�on�n in p�pa�ac�ck�ka�ag�ge�e.�.j�js�so�on�n as requested (p�pa�at�tc�ch�h, m�mi�in�no�or�r, m�ma�aj�jo�or�r,
       etc).

   4.  Run the v�ve�er�rs�si�io�on�n script. These scripts have access to the new
       v�ve�er�rs�si�io�on�n in package.json (so they can incorporate it into file
       headers in generated files for example). Again, scripts should
       explicitly add generated files to the commit using g�gi�it�t a�ad�dd�d.

   5.  Commit and tag.

   6.  Run the p�po�os�st�tv�ve�er�rs�si�io�on�n script. Use it to clean up the file system or
       automatically push the commit and/or tag.


   Take the following example:

     {
       "scripts": {
         "preversion": "npm test",
         "version": "npm run build && git add -A dist",
         "postversion": "git push && git push --tags && rm -rf build/temp"
       }
     }

   This runs all your tests and proceeds only if they pass. Then runs your
   b�bu�ui�il�ld�d script, and adds everything in the d�di�is�st�t directory to the commit.
   After the commit, it pushes the new commit and tag up to the server,
   and deletes the b�bu�ui�il�ld�d/�/t�te�em�mp�p directory.

S�Se�ee�e A�Al�ls�so�o

   •   npm help init

   •   npm help run

   •   npm help scripts

   •   p�pa�ac�ck�ka�ag�ge�e.�.j�js�so�on�n _�⟨_�/_�c_�o_�n_�f_�i_�g_�u_�r_�i_�n_�g_�-_�n_�p_�m_�/_�p_�a_�c_�k_�a_�g_�e_�-_�j_�s_�o_�n_�⟩

   •   npm help config

NPM@11.6.2 October 2025 NPM-VERSION(1)

Potential Solution

--ignore-scripts should be added to the Options: list in npm version -h output.

And a more details explanation of the option should be added to npm help version output.

Docs URL

manpages and --help output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions