Why am I getting an error stating 'This folder name is invalid. The destination cannot be named private' when installing MATLAB or other MathWorks products??

50 views (last 30 days)
When installing MATLAB (or when installing a support package in the Add-Ons explorer), why do I get an error saying "This folder name is invalid. Folder names can contain alphanumeric characters and '-', '_', '.', or '/' only. The destination folder cannot be named "private"?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Sep 2022
Edited: MathWorks Support Team on 29 Sep 2022
If MATLAB is installed:
This error may occur on MacOS when installing a Support Package using the Add-Ons explorer if there is a space or other special character in the file path to the Support Package install directory.
Enter the following command in the MATLAB Command Window to output the full path to your Support Package install directory:
If the file path has any spaces or special characters in it, please remove any spaces or special characters from the file path then close and re-open MATLAB and try to install the Support Package again.
If you can't modify the existing file path, you can point MATLAB to a different directory to install the Support Package in instead. You must have write permissions in the folder, and the file path to the folder must not contain any spaces or special characters. To do so, run the following command:
matlabshared.supportpkg.setSupportPackageRoot(<path to new Support Package install directory>)
Then close and re-open MATLAB and try to install the Support Package again.
If MATLAB is not installed:
Please try starting the installer with a -tmpdir flag. To do so, follow the steps below:
1) Create a folder that will be used temporarily during installation
2) Open Terminal application
3) Drag and drop install script into Terminal from your MATLAB directory that contains installation files to be installed
4) Add -tmpdir flag pointing to your newly created temporary folder in the following manner:
/Users/YourUsername/Downloads/matlab_R2014a_maci64/install -tmpdir /Users/YourUsername/Desktop/temporaryfolder/
Once this command is run in Terminal the issue should be resolved. After the installation is completed you may delete this temporary folder.
barrett rogers
barrett rogers on 9 Oct 2021
Edited: barrett rogers on 9 Oct 2021
wait....this has seriously been going on since 2014?? there should be a more easily located fix on this for people like myself that are totally stupid with code at the moment. i hardly know anything about any of this kind of stuff, i bought matlab to learn, but i cannot use it. please help

Sign in to comment.

More Answers (1)

Robert Andrade
Robert Andrade on 27 Jun 2019
This issue is currently preventing me from installing add-ons, which makes my copy of Matlab useless. Does a reinstallation resolve the issue?

Sign in to comment.


No tags entered yet.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by