Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm run fails on Windows when project folder is case sensitive #3299

Open
1 task done
neilrackett opened this issue May 24, 2021 · 2 comments
Open
1 task done
Labels
Bug thing that needs fixing cmd:run-script related to `npm run-script` platform:windows is Windows-specific Release 7.x work is associated with a specific npm 7 release

Comments

@neilrackett
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When case sensitivity is enabled, all scripts, e.g. npm run build, will fail with the error:

'module_name' is not recognized as an internal or external command

Where module_name is the name of the the module called by the script, e.g. webpack or cross-env

Expected Behavior

npm run should run scripts as normal, unaffected by the case sensitivity setting of the project folder (or its subfolders).

Steps To Reproduce

  1. Open a command prompt or PowerShell window at the location of your project folder
  2. Delete node_modules if it already exists
  3. Make the project folder case sensitive using fsutil.exe file setCaseSensitiveInfo . enable
  4. Run npm i
  5. Try to run any script defined in your package.json file, e.g. npm run build
  6. The script fails with an error similar to 'module_name' is not recognized as an internal or external command

As an alternative to steps 1-4, you could also recursively apply case sensitivity to the content of your project folder using this PowerShell command:

(Get-ChildItem -Recurse -Directory).FullName | ForEach-Object {fsutil.exe file setCaseSensitiveInfo $_ enable}

Environment

  • OS: Windows 10 Pro (Microsoft Windows NT 10.0.19042.0 x64)
  • Node: 14.17.0
  • npm: 7.14.0
@neilrackett neilrackett added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels May 24, 2021
@neilrackett
Copy link
Author

Possibly related to #1782?

@ruyadorno
Copy link
Contributor

I can't reproduce this, I'm particularly stuck with the fsutil.exe file setCaseSensitiveInfo . enable with a Error: The request is not supported. in my windows system (Windows 10 Pro Version 20H2 Build 19042.928).

@npm/cli-team I do wonder whether this is a supported use case, it looks like support to case sensitivity is an opt-in feature in Windows 10.

@neilrackett it would also be appreciated if you can confirm you still have this error with the current version of the npm cli ([email protected] at the time of writing).

@ruyadorno ruyadorno added platform:windows is Windows-specific cmd:run-script related to `npm run-script` and removed Needs Triage needs review for next steps labels Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing cmd:run-script related to `npm run-script` platform:windows is Windows-specific Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants