moreginger
moreginger

Reputation: 560

Cannot run gulp, or other npm commands, from local npm install on Windows

I'm having problems running gulp, and other npm installed commands from the local node_modules path.

For example I'll have a script sass that calls gulp sass and invoke npm run sass, and it claims the gulp binary isn't found ('gulp' is not recognized as an internal or external command,) -> but it's definitely there, in node_modules/bin.

A global install of gulp does work, but that's not an acceptable solution.

Upvotes: 0

Views: 154

Answers (1)

moreginger
moreginger

Reputation: 560

This was caused by a so-called cursed WSL directory with setCaseSensitiveInfo set to true, coupled with the default PATHEXT which contains all CAPS extensions. So when you try to run gulp it looks for gulp.CMD but the distributed command is gulp.cmd.

Adding lowercase variants to PATHEXT appears to have fixed it without having to frob setCaseSensitiveInfo to false everywhere.

Upvotes: 1

Related Questions