Mac Terminal error '-bash: ./js: Permission denied' - command-line

I'm learning JavascriptMVC and I'm running the following command in the Terminal, which I got from here:
./js jquery/generate/app cookbook
I'm new to the command line. All of my Googling is coming up with nothing. I imagine I'm missing some kind of configuration or something?

That error likely means that 'js' isn't executable. If it's in the current directory, you can make it executable with chmod +x js.

Related

ZSH cp returning no matches

I am installing MongoDB4.4 on MacOS and encountered an error while trying to copy the binary files from the MongoDB downloaded package.
To run the binaries I attempting to copy them to /usr/local/bin and run mongo/mongod from terminal windows.
Using command cp mongodb-macos-x86_64-4.4.18/bin/* /usr/local/bin produces the error: zsh: no matches found: mongodb-macos-x86_64-4.4.18/bin/* and I haven't been able to get a match. I've tried specifying the path verbose from the home directory and also changing the directory that I execute the above command from.
Ultimately to save time I caved and manually copy/pasted the executables into /usr/local/bin but how I do handle this in the future? I've seen in some other questions that the behaviour of zsh can be modified and the problem may be related to wildcards but I am hesitant to make changes to the shell which I don't fully understand.

Cannot change read/write permissions on script file /usr/local/bin code

So I recently updated my Mac to iOS Ventura. Since then I am unable to type "code ." into my terminal to open vs code in whatever directory I am in. The error I get is:
/usr/local/bin/code: line 6: python: command not found /usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory
I saw a solution here and the same one somewhere else.
However, when I try was in /usr/local/bin and typed "nano code" I was unable to edit the file. I got the error [ cannot open file for writing: read-only file system ]. I also tried dragging the file into VS code but I had a similar read/write issue. I am also unable to edit the permissions when I right click on the file and hit "get info". There is no option to edit. I also tried changing the permissions on that file using chmod to no avail. It's driving me nuts that I don't have read/write permission for files on my own computer. Does anyone have an idea of how I can have writing permissions on this file?
I do know for the /usr/local/bin/code: line 6: python: command not found you can run sudo vim /usr/local/bin/code and then add 3 to the end of python on this line function realpath() { python<3> -c "import... I guess the new mac update does not support python 2 anymore so you have to specify 3. Still looking into the line 10 error. If I figure it out I will post here again.

Recipe terminated with fatal error: spawn latexmk ENOENT

I have just installed debian 10 as well as vscode. I have been struggling with this for 3 days now.. I installed texlive from terminal with the following command:
sudo apt install texlive
I then installed the latex workshop extension in vscode and tried building a .tex file. The following error popped up:
Recipe terminated with fatal error: spawn latexmk ENOENT.
I then preceded to install latexmk from terminal with:
sudo apt install latexmk
The same error kept popping up after that. The output showed this.
[14:59:34] Recipe step env: {}
[14:59:34] cwd: /home/phoenix/Documents/stellies/year4/2021/s&s-414/pracs/prac-4/report
[14:59:34] LaTeX build process spawned. PID: undefined.
[14:59:35] LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
[14:59:35] Does the executable exist? PATH: /app/bin:/usr/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/node/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/cargo/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/python/bin
[14:59:35] The environment variable $SHELL: /bin/sh
I then proceded to review the texlive website. I noticed that i did not set the path variable to include the texlive binaries. The texlive website gives the following path to the binary files : PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH
however /usr/local/texlive does not exist on my system for some reason. Where can i find the correct path to the texlive binaries on Debian 10?
I had the same problem. The root cause was: (1) software's bin folder missing from PATH; (2) bad file privileges. Consequently, VSC couldn't access latexmk, which explains the error messages.
In my case, the problem occurred on a mac, and specifically after I installed MacTex, which, in turn, installs Tex Live. I believe the same solution may apply to linux distros too.
Solution:
Claim file ownership (which was originally root) under folder /usr/local/texlive: sudo chown -R <username> /usr/local/texlive, where <username> is the OS-level user name. The fix will work for this specific user. If it is not enough, try instead setting group owner appropriately, and/or consider Step 3.
Add /usr/local/texlive/2021/bin/<software_dialect> to PATH. <software_dialect> depends on the installed software version: in my case it is universal-darwin; on linux it might be x86_64-linux.
If the problem persists, try to change file access permissions under /usr/local/texlive using chmod.
EDIT: As a final step, restart VSC for changes to take effect.
I recently encountered the same problem on MacOS Monterrey (M1 based). I used basictex (just for the context). As required by the installation instruction,
I added TeXLive to PATH,
installed latexmk package to the TeX distribution.
However, still got the same error as OP.
Afte reading the wiki again more carefully, what finally worked for me was as simple as restarting VS Code and MacOS. Everything works as expected after a reboot of the MAC.
I had this same problem on Mac recently, the fix that worked for me was to uninstall and reinstall the LaTeX Workshop extension.
I got the same issue , seems to be a misbehaving from Vscode on MacOS
check if the command is in the path on mac
-which command_you are running example which latexmk
If this output something that means you have your latex installed, otherwise go and installed it and make sure it is accessible via command line.
If latex is installed and you are getting that issue you can just restart your VSCode and everything will be okay.
Had a similar error and came across this post when looking for a solution.
I wanted to use texlive on Vscode with WSL2 on Windows 10. Installing texlive-full in wsl fixed this error for me.
On Mac, this is a way to fix the issue
Step1: reinstall mactex by downloading it from this link: http://www.tug.org/mactex/mactex-download.html
Step2: In your terminal do cd /usr/local, you should see texlive folder
Step3: In your terminal do sudo vim etc/paths to set the environment. Details are in this link: https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/
Step4: In your terminal do /usr/local/texlive/2021/bin/x86_64-linux at the bottom. check the folder to see if the year is correct. Details in: http://www.tug.org/texlive/quickinstall.html.
Step5: Quit VC code completely, and reopen it.

Can't connect to jupyter server in vscode

My settings file looks like this
{
"python.pythonPath": "/home/username/.conda/envs/myenv/bin/python",
"terminal.integrated.inheritEnv": false
}
And I can see the conda environment in the interpreter that I'd like to activate from vscode interpreter selections but whenever I try to run the a cell in vscode I get a long error message.
Activating Python 3.7.7 64-bit ('myenv': conda) to run Jupyter failed with Error: Command failed: . activate myenv && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/username/.vscode/extensions/ms-python.python-2020.8.105369/pythonFiles/pyvsc-run-isolated.py /home/username/.vscode/extensions/ms-python.python-2020.8.105369/pythonFiles/printEnvVariables.py bash: activate: No such file or directory .
I chdecked my $PATH variable and it each directory existed in it. (Looks like how other stack questions suggested it should look as well)
What am I missing? I had it working on a similar machine a couple weeks ago but I can't seem to get it to work now.
I'm on Ubuntu 20.04 if that's important.
I am not completely familiar with the issue, but some digging around lead me to this, try these settings
"terminal.integrated.env.linux": {
"PATH": ""
}
If that doesn't work please reference this link. They seem to be experiencing the same issue as you, but on windows. You may be able to extract more information from it than I could. Sorry if this didn't help.
After messing around quite a bit, I made a new environment and it worked. I'm not sure what I did within that environment to make vscode unhappy with it but vscode didn't like something about it.
Before making the new environment I also ran a few commands including
sudo chown -R $USER:$USER ~/.conda
sudo chown -R $USER:$USER ~/miniconda3
conda update -n base -c defaults conda
I'm not sure what got it to work but I'm happy it's working now!

Mac OS: How do you fix a PATH to reach an executable file (in this case postgresql & netlify-cli) without messing up other paths?

In the mac terminal:
Does anyone know how to set the path variables for a Mac OS, without messing up other paths?
Current folder structure:
/
/Applications
/[a lot of applications]
/Postgres.app
/Contents
/Versions
/12
/bin
/psql
/Users
/userName
/Applications
/[nothing, except a couple hidden files]
Right now, if I run the command psql, I am getting:
command not found
If I type the full path:
/Applications/Postgres.app/Contents/Versions/12/bin/psql
it works, but typing this every time is not practical.
If I run git that command is available, or code .
Also, I installed netlify-cli globally with npm install -g netlify-cli, but when I run netlify-cli, I get:
command not found
and I don’t know where to find it in my system
… So, something is working correctly with my paths, and something is not. I don’t know how to fix the problem, without messing up other paths.
Does anyone know how I could find out where netlify-cli got installed and fix my paths to netlify-cli and psql without messing up any other paths?
For Mac OS to be able to find the psql executable, it has to be part of the PATH environment variable, you can check the value of that variable on your terminal with this command
echo $PATH
what you should do is add the psql executable to it, like this:
export PATH=/Applications/Postgres.app/Contents/Versions/12/bin/:$PATH
if that solves your problem, you can put that on your .zshrc or .bashrc to make it persistent