nova-prettier
nova-prettier copied to clipboard
NPM loading issue
Hi,
I've been trying to resolve this myself for the last month or so using the instructions in the error message, but I'm not having success.
I sometimes (50% of the time) get the attached error when launching Nova around NPM not loading. I have copied everything from my ~/.zshrc to ~/.zprofile (probably overkill to copy, but for debugging reasons...). I have also tried sourcing the zshrc file itself within zprofile.
Notably, my ~/.zprofile does have the NVM initialization:
#nvm
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
Usually I can get past this error by launching a terminal window first, followed by Nova. If I launch Nova on it's own from a fresh reboot, I get the error. So, I think perhaps the terminal is loading something into memory when it loads the zshrc file that Nova is not from the zprofile.
I reached out to Nova for support, but they directed me to you since Prettier is loading NPM itself, not Nova.
Any thoughts or suggestions?
Josh
Hm! I don't load Node.js via NVM, but rather I got it installed via brew install npm
; also, I'm a die-hard bash
fan and haven't switched to zsh
, so...
... inside Nova, what do you see (regarding NVM_DIR
) under Preferences > Tools? You can also check Automatically request environment from login shell and see if Nova is properly setting NVM_DIR
; and, if all else fails, you can use Custom Global Environment Variables and set NVM_DIR
manually there.
Hey Gwyneth.
Yeah, it looks like I do have that setup, but this give me something to dig into deeper.
Josh
I can reproduce it, but it's a bit hard to do so, so I haven't quite figured out what the fix might be.
Installed Prettier and I also get this every time I open Nova. Just installed Nova today, so it couldn't be any pre-existing settings of mine.
Can't find nom and prettier Prettier couldn't be found because npm isn't available. Please make sure you have Node installed. If you've only installed Node through NVM, you'll need to change your shell configuration to work with Nova. See https://library.panic.com/nova/environment-variables/
This issue should be resolved in the latest pre-release.
2.5.0 is out now and should fix this. I'll close this, but please feel free to re-open if you still run into issues.