nova-prettier icon indicating copy to clipboard operation
nova-prettier copied to clipboard

NPM loading issue

Open joshwalsh opened this issue 3 years ago • 3 comments

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.

Screen Shot 2022-01-10 at 11 00 07 AM

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

joshwalsh avatar Jan 11 '22 17:01 joshwalsh

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.

GwynethLlewelyn avatar Feb 09 '22 21:02 GwynethLlewelyn

Hey Gwyneth.

Yeah, it looks like I do have that setup, but this give me something to dig into deeper.

Screen Shot 2022-02-09 at 4 37 49 PM

Josh

joshwalsh avatar Feb 09 '22 21:02 joshwalsh

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.

alexanderweiss avatar Feb 20 '22 12:02 alexanderweiss

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/

wes-derrohe avatar Jan 27 '23 15:01 wes-derrohe

This issue should be resolved in the latest pre-release.

alexanderweiss avatar Apr 16 '23 10:04 alexanderweiss

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.

alexanderweiss avatar Apr 16 '23 18:04 alexanderweiss