npm / npm/cli

[BUG] webpack-cli installation failure

Open
#4,198 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

modules seem to install correctly but is not.

  • Install nodejs
  • create new folder
  • run npm init -y
  • run npm install webpack webpack-cli --save-dev
    Result:
up to date, audited 1 package in 20s
found 0 vulnerabilities
  • Check the node_modules folder:
d-----        28-12-2021     11:08                @discoveryjs
d-----        28-12-2021     11:08                @types
d-----        28-12-2021     11:08                @webassemblyjs
d-----        28-12-2021     11:08                @webpack-cli
d-----        28-12-2021     11:08                @xtuc
-a----        28-12-2021     11:08            111 .package-lock.json
  • Run npm ls:
+-- UNMET DEPENDENCY webpack-cli@^4.9.1
`-- UNMET DEPENDENCY webpack@^5.65.0
npm ERR! code ELSPROBLEMS
npm ERR! missing: webpack-cli@^4.9.1, required by nieuwe-map@1.0.0
npm ERR! missing: webpack@^5.65.0, required by nieuwe-map@1.0.0
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ewald\AppData\Local\npm-cache\_logs\2021-12-28T13_27_47_436Z-debug.log
  • Run webpack: webpack : The term 'webpack' is not recognized as the name of a cmdlet, function, script file, or operable program.

  • webpack is not found in the folder nor in %AppData%\npm\node_modules nor in C:\Program Files\nodejs\node_modules

  • run npm update:

added 119 packages, and audited 120 packages in 2m
15 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
  • Everything is installed correctly
  • Install another package: npm install nice-select2
  • webpack is gone
  • run npm update, works again
Expected Behavior

I should not have to invoke npm update, the first install should work straight away

Steps To Reproduce
  1. Install nodejs on windows 11
    • Install nodejs
  • create new folder
  • run npm init -y
  • run npm install webpack webpack-cli --save-dev
Environment

System:
OS: Windows 10 10.0.22000
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 8.60 GB / 15.74 GB
Binaries:
Node: 14.17.6 - C:\Program Files\nodejs\node.EXE
npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 96.0.4664.110
Edge: Spartan (44.22000.120.0), Chromium (95.0.1020.40)
Internet Explorer: 11.0.22000.120
Packages:
webpack: ^5.65.0 => 5.65.0
webpack-cli: ^4.9.1 => 4.9.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows 11 setup with Node 14.17.6 and npm 8.3.0, then compare npm install webpack webpack-cli --save-dev, npm ls, and npm update. Start by investigating why the first install reports success while dependencies are missing; done means the initial install leaves webpack and webpack-cli present and npm ls clean without requiring npm update.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.