Typing node --version
and "node" --version
in cmd.exe on Windows both give the same result. But npm --version
and "npm" --version
don’t!
C:\>node --version
v14.7.0
C:\>"node" --version
v14.7.0
C:\>npm --version
6.14.7
C:\>"npm" --version
internal/modules/cjs/loader.js:1088
throw err;
^
Error: Cannot find module 'C:\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1085:15)
at Function.Module._load (internal/modules/cjs/loader.js:928:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
internal/modules/cjs/loader.js:1088
throw err;
^
Error: Cannot find module 'C:\node_modules\npm\bin\npm-cli.js'
[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1085:15)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:928:27)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)[39m
[90m at internal/main/run_main_module.js:17:47[39m {
code: [32m'MODULE_NOT_FOUND'[39m,
requireStack: []
}
Neither do echo test
and "echo" test
:
C:\>echo test
test
C:\>"echo" test
'"echo"' is not recognized as an internal or external command,
operable program or batch file.
In bash, quoting the program name makes no difference as far as I know. Why does it make a difference in cmd.exe, sometimes?