Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"nvm use 16.13.0" will return this error "exit status 145: The directory is not empty."

Tags:

node.js

gulp

nvm

I have 2 versions of node.js , as follow:-

Your environment has been set up for using Node.js 17.1.0 (x64) and npm.

C:\Windows\System32>nvm list

    16.13.0
    8.16.2

but when i try to use the first version i got this error:-

C:\Windows\System32>nvm use 8.16.2
node v8.16.2 (64-bit) is not installed.

and when i try to use the second version i got this:-

C:\Windows\System32>nvm use 16.13.0
exit status 145: The directory is not empty.

so what is going on? thanks

like image 957
john Gu Avatar asked Nov 12 '21 21:11

john Gu


People also ask

Does NVM install NPM?

How to install npm via Node. Now that nvm is installed, we're ready to do what we really wanted to do in the first place: install npm and Node on our system. It's not a bad idea to confirm nvm is installed properly, by running nvm -v . If the terminal shows you the installed version number, you're good to go!

How do I uninstall Node using NVM?

NVM allows you to uninstall Node versions that are no longer required. Run the command nvm uninstall with the version of Node you'd like to remove. You cannot remove a version you are currently using, so you must switch to a different version first. NVM confirms the Node version has been removed.

Can we use NVM without admin rights?

NVM (Node Version Manager) is the best way to run multiple versions of NodeJS on the same machine. It's not only for Windows but in this post I will talk about my experience to install NVM on a Windows machine without Admin Rights.

Why does NVM return an exit status 145 error?

node.js - "nvm use 16.13.0" will return this error "exit status 145: The directory is not empty." - Stack Overflow "nvm use 16.13.0" will return this error "exit status 145: The directory is not empty." Your environment has been set up for using Node.js 17.1.0 (x64) and npm.

What does exit status 145 mean in Linux?

exit status 145: The directory is not empty. The error message " exit status 145: The directory is not empty. " , is not clear meaning for which directory is not empty , because the directory underline I running the command " nvm use 16.10.0 " , is a new directory and is empty .

What does'NVM use 145'mean?

'NVM use' giving an exit status: "exit status 145: The directory is not empty." #553 Closed 6 of 20 tasks therajaryanopened this issue Jun 28, 2020· 5 comments

How do I fix NVM use XXXX error?

Then try again nvm use XXXX (xxxx is the version) I meet same issue. I have resolved as: Make sure you delete all old nodejs. step 1:uninstall nodejs and remove node_home and npm_home; step 2: download nvm and Install it.


3 Answers

if it is a Windows machine go to C:\Program Files\nodejs. Then rename that folder to C:\Program Files\nodejsx. After that please check "nvm use v.v.v."

like image 185
Bhabani P Avatar answered Nov 02 '22 22:11

Bhabani P


I just fixed it by uninstalling Node.js from the Settings -> Apps menu. According to the https://github.com/coreybutler/nvm-windows/pull/615 pull request, nvm cannot change the version because it's conflicting with the normally installed Node.js version. Try deleting Node.js from the Apps settings menu.

like image 36

When this happen:

C:\Windows\System32>nvm use 16.13.0
exit status 145: The directory is not empty.

Just make sure, the nodejs folder is empty, check C:\Program Files\nodejs or C:\Program Files (x86)\nodejs, otherwise delete the content. Then try again nvm use XXXX (xxxx is the version)

like image 30
Oscar Albert Avatar answered Nov 02 '22 23:11

Oscar Albert