npm / npm/cli

[BUG] <`npm` is case-sensitive towards the drive letter in Windows 10 causing module name errors when using `npm run dev` in a NextJS project in the eshell tool within emacs>

Open
#4,593 0 comments 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

I am an emacs user attempting to use eshell to use npm run dev in a NextJS project. I've configured the project from scratch as per the next docs, and this is the output:

image

Expected Behavior

The expected behavior should be that the server runs with no errors or warnings given that the project was setup exactly as the next docs instruct. I will note that if you delete node_modules and use the driveup tool in M-x shell instead of eshell, re-install the next dependencies and run npm run dev, it works as expected, so the lowercase drive letter is the issue.

Steps To Reproduce
  1. Install emacs as a scoop app:
scoop bucket add extras
scoop install emacs
  1. Run emacs -Q in PowerShell (do not use an init file, run as default emacs)
  2. Run M-x eshell and cd into an empty directory to configure the project
  3. Run npm i next react react-dom
  4. Edit the package.json with M-x find-file to add:
"scripts": {
  "dev": "next dev"
},
  1. Run npm run dev
  2. See error.
Environment
  • npm: 8.1.0
  • Node.js: 16.13.0
  • OS Name: Windows 10 Pro
  • System Model Name: Dell Precision 5760
  • npm config:
; "builtin" config from c:\Program Files\nodejs\node_modules\npm\npmrc

prefix = "C:\\Users\\me\\AppData\\Roaming\\npm"

; "user" config from C:\Users\me\.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = c:\Program Files\nodejs\node.exe
; cwd = c:\Users\me\pandora\test-bug
; HOME = C:\Users\me
; Run `npm config ls -l` to show all defaults.

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

Start by reproducing the report's Windows 10 setup with Emacs eshell, npm i next react react-dom, and npm run dev, comparing the lowercase and uppercase drive-letter paths. Then trace npm's handling of those paths; no source file or test is named in the report. Done means the Next.js development server runs without module-name errors in the stated setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, javascript, nextjs, nodejs
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.