How to fix npm ERR! code EMISSINGARG npm ERR! Missing required argument in npm

npmBEGINNERHIGHUpdated Dec 5, 2025ยท 154 views

EMISSINGARG occurs when npm is unable to properly parse command arguments, typically due to using an outdated npm version or missing required parameters. Update npm and verify your command syntax.

Quick fix

Fixes EMISSINGARG

npm --version
node --version
  1. Check your current npm and Node.js versions
  2. Clear the npm cache
  3. Upgrade npm to the latest version
  4. Upgrade Node.js to a current LTS version
npm โ€” error
npm --version
node --version
npm ERR! code EMISSINGARG
npm ERR! Missing required argument

What this error means

The 'npm ERR! code EMISSINGARG' error occurs when npm is unable to properly parse command arguments, typically due to using an outdated version of npm (especially npm v3.x) that cannot handle modern package structures and dependencies. This error indicates that a required argument is missing from an npm command, or that npm's internal argument parsing has failed. The error commonly occurs during 'npm install', 'npm update', or 'npm uninstall' operations when the npm version on your system is no longer compatible with current packages in the npm registry.

Typical symptoms

  • npm install fails with 'TypeError Error: Missing required argument #1' (or #2, #3)
  • npm update -g produces EMISSINGARG errors even though the command appears correct
  • npm uninstall package-name fails with missing argument errors despite proper syntax
  • Error originated from fetch-package-metadata.js or similar internal npm files
  • npm commands that previously worked suddenly fail after updating package.json

Common causes

  1. Using an outdated version of npm (particularly npm v3.x series) that has bugs in argument parsing
  2. Node.js version is outdated and doesn't include a compatible npm version
  3. npm installed via apt-get or system package manager on Linux/Ubuntu rather than via NodeSource or nvm
  4. Corrupted or incompatible npm cache preventing proper package metadata parsing
  5. npm configuration in .npmrc file has invalid syntax or deprecated settings
  6. Using older npm flags or options that are no longer supported in modern npm versions

How to fix "npm ERR! code EMISSINGARG npm ERR! Missing required argument"

1Check your current npm and Node.js versions

First, verify which versions you're running:

bash
npm --version
node --version

If npm is version 3.x or Node.js is below v10.x, you have outdated software. Modern development requires at least npm v6+ and Node.js v14+.

2Clear the npm cache

Before upgrading, clear your npm cache to remove any corrupted metadata:

bash
npm cache clean --force

This removes cached package data that may be causing parsing issues.

3Upgrade npm to the latest version

Update npm to the current version (v8+ or v9+):

bash
npm install -g npm@latest

If that doesn't work with your outdated npm, try:

bash
sudo npm i -g npm

After upgrading on Linux/macOS, refresh your shell to recognize the new npm location:

bash
hash -r
4Upgrade Node.js to a current LTS version

If npm upgrade alone doesn't solve it, upgrade Node.js:

Using Node Version Manager (nvm) - recommended:

bash
nvm install --lts
nvm use --lts

On Linux (using NodeSource repository):

bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

After upgrading, verify:

bash
node --version
npm --version
5Delete node_modules and package-lock.json, then reinstall

After upgrading npm and Node.js, remove cached dependencies and reinstall:

bash
rm -rf node_modules package-lock.json
npm install

On Windows (PowerShell):

powershell
Remove-Item -Recurse -Force node_modules
Remove-Item package-lock.json
npm install
6Verify your npm command syntax is correct

Double-check that your npm commands follow the correct syntax:

Correct examples:

bash
npm install                    # Install all dependencies
npm install express           # Install a specific package
npm uninstall express         # Remove a package
npm install --save-dev mocha  # Install as dev dependency

Incorrect examples that trigger this error:

bash
npm install --save-dev         # Missing package name
npm uninstall                  # Missing package name

Advanced notes

The EMISSINGARG error is fundamentally a version compatibility issue. npm v3.x had bugs in the fetch-package-metadata.js module that prevented it from properly parsing modern package structures. These bugs were fixed in npm v6+. If you're in a Docker container or CI/CD environment, ensure your base image uses a modern Node.js version - for example, use 'FROM node:20-alpine' rather than 'FROM node:8'. On Linux systems using apt-get installed Node.js, the package manager repositories are notoriously behind; use NodeSource repositories or nvm instead.

Frequently asked questions

What does "EMISSINGARG" mean?
The 'npm ERR! x) that cannot handle modern package structures and dependencies. This error indicates that a required argument is missing from an npm command, or that npm's internal argument parsing has failed.
How do I fix "EMISSINGARG"?
EMISSINGARG occurs when npm is unable to properly parse command arguments, typically due to using an outdated npm version or missing required parameters. Update npm and verify your command syntax.
What causes "EMISSINGARG"?
Using an outdated version of npm (particularly npm v3.x series) that has bugs in argument parsing Node.js version is outdated and doesn't include a compatible npm version npm installed via apt-get or system package manager on Linux/Ubuntu rather than via NodeSource or nvm
Is the "EMISSINGARG" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading