Installing serverless 1.17.0 produces an error when installing autocompletion on Git Bash on Windows
See original GitHub issueThis is a (Bug Report / Feature Proposal)
Description
For bug reports:
-
What went wrong? Installing Serverless 1.17.0 via
npm install serverless -g
I get an error saying that the autocomplete scripts could not be installed. -
What did you expect should have happened? Serverless install would complete without error and autocompletion package would work.
-
What was the config you used?
npm install serverless -g
on Windows 10 using the “Git Bash” application that is included with an installation of Git. -
What stacktrace or error message from your provider did you see?
fs.js:641
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'C:\Users\<user>\AppData\Roaming\npm\node_modules\
serverless\node_modules\tabtab\scripts\C:\Program Files\Git\usr\bin\bash.sh'
at Error (native)
at Object.fs.openSync (fs.js:641:18)
at fs.readFileSync (fs.js:509:33)
at Complete.script (C:\Users\<user>\AppData\Roaming\npm\node_modules\serverless\node_modules\
tabtab\src\complete.js:373:14)
at Installer.writeTo (C:\Users\<user>\AppData\Roaming\npm\node_modules\serverless\node_module
s\tabtab\src\installer.js:91:34)
at Installer.handle (C:\Users\<user>\AppData\Roaming\npm\node_modules\serverless\node_modules
\tabtab\src\installer.js:80:21)
at Commands.install (C:\Users\<user>\AppData\Roaming\npm\node_modules\serverless\node_modules
\tabtab\src\commands\index.js:75:22)
at Object.<anonymous> (C:\Users\<user>\AppData\Roaming\npm\node_modules\serverless\node_modul
es\tabtab\src\cli.js:33:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
Could not auto-install serverless autocomplete script.
Please copy / paste the script above into your shell.
This looks like an error inside of the tabtab package. I will report it there, but since this produces an error in the Serverless install I thought you’d want to know also.
Looking at the source of tabtab\src\complete.js at line 373 it is using a variable to try to find the right .sh file to load. It is trying to parse this out of the shell information but on Windows in Git Bash it is staying the full path to bash.
For feature proposals:
- What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
- If there is additional config how would it look
Similar or dependent issues: https://github.com/mklabs/node-tabtab/issues/36
Additional Data
- Serverless Framework Version you’re using: 1.17.0
- Operating System: Windows 10 (64 bit)
- Stack Trace: (Shown above)
- Provider Error messages:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
I had the same issue (also in Git Bash on Win 10). A workaround is to manually run
tabtab install --name serverless
, and choose “Bash config file (~/.bashrc)”… It seems to be an issue with--auto
and the Windows path replacements done by Git Bash.Serverless just shouldn’t be messing with tab completion at all unless a user requests it. This breaks so many expectations.
Please refer to #4069 for more.