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

npm install does not write to .zshrc on Linux #135

Open
bound-variable opened this issue Feb 18, 2022 · 6 comments
Open

npm install does not write to .zshrc on Linux #135

bound-variable opened this issue Feb 18, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@bound-variable
Copy link

bound-variable commented Feb 18, 2022

Describe the bug
Following the npm installation, no changes are made to .zshrc.

To Reproduce

  1. Run npm install -g typewritten
  2. Check .zshrc

Expected behavior
Changes to .zshrc

Desktop (please complete the following information):

  • OS: Arch
  • Browser [qutebrowser]
  • Version [1.4.6]

Additional context
My zsh folder abides by XDG specs, and is specified by the environment variable ZDOTDIR, pointing to ~/.config/zsh.

Manual installation works.

@reobin
Copy link
Owner

reobin commented Feb 19, 2022

Hi @Pound-Hash ! Thank you for bringing up this issue.

Do you have any error message during the npm installation?

Here are the lines of code trying to insert to your .zshrc:

append_zshrc() {
  info "These lines will be added to your \"${ZDOTDIR:-$HOME}/.zshrc\" file:"
  code "$@"
  echo "$@" >> "${ZDOTDIR:-$HOME}/.zshrc"
}

...
msg = ...
...

if append_zshrc "$msg"; then
  success "Done! Please, reload your terminal."
  echo
else
  error "Cannot automatically insert prompt init commands."
  error "Please insert these line into your \"${ZDOTDIR:-$HOME}/.zshrc\" file:"
  code "$msg"
  exit 1
fi

It should either print "Done!" or the error message

@bound-variable
Copy link
Author

Hi @Pound-Hash ! Thank you for bringing up this issue.

Do you have any error message during the npm installation?

I don't.

Here's the output:

❯ sudo npm install -g typewritten

added 1 package, and audited 2 packages in 638ms

found 0 vulnerabilities
❯ echo $?
0

@reobin
Copy link
Owner

reobin commented Feb 25, 2022

Thank you @Pound-Hash for the details! I'll have a look whenever I have time to reproduce it.

@all-contributors please add @Pound-Hash for bugs

@allcontributors
Copy link
Contributor

@reobin

I've put up a pull request to add @Pound-Hash! 🎉

@reobin reobin added bug Something isn't working and removed troubleshooting labels Feb 25, 2022
@reobin reobin changed the title npm installation doesn't work npm install does not write to .zshrc on Linux Feb 25, 2022
@ganler
Copy link

ganler commented Oct 7, 2022

Same issue here. The installation does not work for Ubuntu 22.04.

@suckerSlayer
Copy link

Same issue. ButI found the npm installation way works when I login as a root. While it doesn't work when I install it as a normal user, and if I try prompt -l, the result doesn't include typewritten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants