nvm icon indicating copy to clipboard operation
nvm copied to clipboard

nvm.sh is automatically deleted, after install instruction completed

Open TomZhooooou opened this issue 2 years ago • 24 comments

Operating system and version:

macOS 13.4

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

What steps did you perform?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

What happened?

nvm.sh is not there and git status showed it was deleted

What did you expect to happen?

Is there anything in any of your profile files that modifies the PATH?

.zshrc

If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 15037 100 15037 0 0 69402 0 --:--:-- --:--:-- --:--:-- 70596 => Downloading nvm from git to '/Users/.nvm' => Cloning into '/Users/.nvm'... remote: Enumerating objects: 361, done. remote: Counting objects: 100% (361/361), done. remote: Compressing objects: 100% (307/307), done. remote: Total 361 (delta 40), reused 167 (delta 28), pack-reused 0 Receiving objects: 100% (361/361), 221.43 KiB | 2.99 MiB/s, done. Resolving deltas: 100% (40/40), done.

  • (HEAD detached at FETCH_HEAD) master => Compressing and cleaning up git repository

=> Appending nvm source string to /Users.zshrc => Appending bash_completion source string to /Users/.zshrc bash: line 435: /Users/.nvm/nvm.sh: No such file or directory => You currently have modules installed globally with npm. These will no => longer be linked to the active version of Node when you install a new node => with nvm; and they may (depending on how you construct your $PATH) => override the binaries of modules installed with nvm:


TomZhooooou avatar Jul 26 '23 00:07 TomZhooooou

How could nvm.sh be deleted? Nothing I'm aware of would do that. Can you elaborate?

ljharb avatar Jul 26 '23 00:07 ljharb

even after I copied nvm.sh to the directory ~/.nvm/, the nvm.sh file will still disappear after it's shown for a second.

From the installation output generated, you can see that:

...... bash: line 435: /Users/.nvm/nvm.sh: No such file or directory

The nvm.sh is not found by the install.sh

TomZhooooou avatar Jul 26 '23 00:07 TomZhooooou

Wait, why /Users/.nvm? there's no user called .nvm, it should be installed in $HOME/.nvm. What's $HOME?

ljharb avatar Jul 26 '23 01:07 ljharb

That's not an issue, I hided it. $HOME is /Users/[company_name]

TomZhooooou avatar Jul 26 '23 01:07 TomZhooooou

ah ok, thanks for clarifying. if you make a new file at $NVM_DIR/nvm.sh, does that vanish too?

ljharb avatar Jul 26 '23 01:07 ljharb

I just tried that, I am able to create nvm.sh with command like cat > nvm.sh. And I copied and pasted the actual content into it. Now I am able to run install.sh successfully.

TomZhooooou avatar Jul 26 '23 01:07 TomZhooooou

That's still confusing; I can't conceive of any command in install.sh or nvm.sh that would affect nvm.sh.

ljharb avatar Jul 26 '23 01:07 ljharb

Yes, I am confused too. I tried to delete the dir and run the command "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash" couple of times. It remains the same, but if I git clone the repo and then run install.sh it works fine

TomZhooooou avatar Jul 26 '23 18:07 TomZhooooou

Funnily enough I'm getting this too and I have no idea what's causing it. I do a have a dotfiles repo that I run setup from, but I just cannot make this work...I tried various ways of creating and recreating this file, but it just keeps getting deleted

aspin avatar Jul 27 '23 19:07 aspin

@aspin same mac OS version?

ljharb avatar Jul 27 '23 19:07 ljharb

I guess there's some possibility that my new work laptop is causing this? I cannot paste the contents of nvm.sh into a file at all, and any file with its contents just gets auto deleted.

 ✘  aspin@macbook-R2GLXYJWXP  ~  ls
Desktop/    Documents/  Downloads/  Library/    Movies/     Music/      Pictures/   Public/     dotfiles/   virtualenv/ workspace/
 aspin@macbook-R2GLXYJWXP  ~  pbpaste > foo
 aspin@macbook-R2GLXYJWXP  ~  ls
Desktop/    Documents/  Downloads/  Library/    Movies/     Music/      Pictures/   Public/     dotfiles/   foo         virtualenv/ workspace/
 aspin@macbook-R2GLXYJWXP  ~  ls
Desktop/    Documents/  Downloads/  Library/    Movies/     Music/      Pictures/   Public/     dotfiles/   foo         virtualenv/ workspace/
 ✘  aspin@macbook-R2GLXYJWXP  ~  cp foo foo.sh
 aspin@macbook-R2GLXYJWXP  ~  ls
Desktop/    Documents/  Downloads/  Library/    Movies/     Music/      Pictures/   Public/     dotfiles/   foo         virtualenv/ workspace/

aspin avatar Jul 27 '23 19:07 aspin

@ljharb 13.2.1

Tried on my old 12.4 macbook and it works fine.

aspin avatar Jul 27 '23 19:07 aspin

Do you have any kind of "antivirus" or corporate spyware installed? Normally these things aren't needed on a Mac, but perhaps it's misidentifying some part of the file as harmful and deleting it.

ljharb avatar Jul 27 '23 19:07 ljharb

Yep, looks like it. Have something called Sentinel One that's picking this file up bleh

aspin avatar Jul 27 '23 19:07 aspin

@TomZhooooou do you have "Sentinel One" installed as well?

@aspin do you have any links to where I could report the problem with them?

ljharb avatar Jul 27 '23 19:07 ljharb

will have to let you know later...i haven't actually started work at this place yet so I don't have all the IT contact points I need to figure this out

aspin avatar Jul 27 '23 20:07 aspin

well, the issue just fixed itself for me. dunno what's up or if it'll fail again in the future 🤦

aspin avatar Jul 27 '23 20:07 aspin

@TomZhooooou do you have "Sentinel One" installed as well?

@aspin do you have any links to where I could report the problem with them?

Yes, I have "Sentinel One" installed in my work laptop, seems like this is the cause

TomZhooooou avatar Jul 27 '23 21:07 TomZhooooou

@TomZhooooou do you have any links for that product, so i can report to them that it's broken?

ljharb avatar Jul 27 '23 21:07 ljharb

This is also happening to me. Reverting back to 0.38.0 fixed it for me.

charlesbthomas avatar Sep 07 '23 02:09 charlesbthomas

@charlesbthomas do you also use Sentinel One?

ljharb avatar Sep 07 '23 02:09 ljharb

@charlesbthomas do you also use Sentinel One?

Looks like it. This is a new workstation.

charlesbthomas avatar Sep 07 '23 02:09 charlesbthomas

Can you provide some contact mechanism for it, so i can report the bug?

ljharb avatar Sep 07 '23 03:09 ljharb

ping @dorweiss - any chance you could connect me to the right person at Sentinel One to address this?

ljharb avatar Jun 10 '24 05:06 ljharb