Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

fatal: 'submodule' appears to be a git command, but we were not able to execute it. Maybe git-submodule is broken? #20

Closed
JimiC opened this issue Jun 17, 2018 · 2 comments

Comments

@JimiC
Copy link
Contributor

JimiC commented Jun 17, 2018

OS: Windows 10
Node: Any
npm: 6.1.0

As mentioned in npm/npm#20815

@JimiC
Copy link
Contributor Author

JimiC commented Jun 17, 2018

The commit to blame is e4ecc54

Using https://github.com/laggingreflex/npm-lifecycle-windows-path-issue with node@10.4.1 and npm@6.1.0 with the offending code stripped, npm test works as expected.

@JimiC
Copy link
Contributor Author

JimiC commented Jun 17, 2018

Looking at index.js code I cannot justify the addition of

if (process.platform === 'win32') {
    env.path = env.PATH = env.Path = env[PATH]
 }

At line https://github.com/npm/npm-lifecycle/blob/v2.0.3/index.js#L24 the code does the handling for the case that the Path environment variable in Windows is defined with different casing.
Now even in the case where Path is not defined at all (which is highly unlikely), line 25 makes sure that it gets defined using the name Path. Therefore

env[PATH] = pathArr.join(process.platform === 'win32' ? ';' : ':')
sets the variable with whatever casing it was found and in case it was not it's getting defined as Path.

I really cannot think why @laggingreflex code did not work for him at first. Maybe the node version he used was buggy causing the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant