Trying to add image in Git add but keep getting the following message? I tried restarting/reloading git and closing VS Code but nothing worked - css

That is:
hashanp#DESKTOP-9E00J4S: ~/cats-cakes$ git add .
error: open("img/cake.jpg"): Permission denied
error: unable to index file img/cake.jpg
fatal: adding files failed
Trying to add image in Git add but keep getting the following message? I tried restarting/reloading git and closing VS Code but nothing worked.

That looks like a git bash session on Windows, or a WSL session.
If you can not easily identify the process which keeps an handle to that file, preventing another program (like git) to access it, I would:
reboot
restart my git bash or WSL2 session
try to add img/cake.jpg before opening any IDE.
Since it is an Ubuntu session, I would also try, for tesdting:
sudo chmod -R 755 img
That way, the folder img will be accessible.

Related

RStudio Server returns "Cannot read property 'error' of null"

When I try to go into RStudio Server (1.0.44), I get the following error in the browser:
RStudio Initialization Error
(TypeError) : Cannot read property 'error' of null
This happens before logging in - it has the rotating clock thing for a minute and goes straight into that.
I have tried all sorts of remedies, including restarting the server, rebooting, uninstalling and reinstalling RStudio server, changing the port settings, deleting the .RStudio folder in my home directory, etc. I checked the system log and that didn't seem to have anything relevant. There were a few errors, of course, but nothing after I got the error.
Also, R works fine from the terminal and I have the latest version of both R and RStudio.
Anyone have any ideas?
You probably tried to restart rstudio already, but this is not enough.Follow these steps:
Do a ps -u user where user is one of the user whose session is returning the error in the browser
[root]# ps -u username
PID TTY TIME CMD
19445 ? 00:00:18 rsession
kill the rsession related to it using it's PID.
[root]# kill 19445
start rstudio using sudo rstudio-server start.
Go to the folder contained within the project you were working with last and delete the ProjectName.Rproj file.
restart rstudio using sudo rstudio-server restart
P.S:
If after second step, problem remains, you could remove the .Rproj file using command line: rm directory/of/Rproj/File/ProjectName.Rproj
rm -r .rstudio
sudo rstudio-server suspend-all
worked for me.
I first also moved .RData to a separate folder and upgraded the rstudio server. However, still the problem remained.
I went through a lot of trouble and have finally managed to get it to work again. What ultimately seems to have worked is upgrading to the newest version (1.0.136), deleting all .Rhistory and .Rproj.user files, stopping the server and deleting the .rstudio file in my user profile, and then restarting. I wish I had more info on why it stopped and what fixed it exactly, but at least it's working again. Note that when I upgraded--and before deleting the .rstudio folder (which I had already done a few times), the error message changed to:
Status code 500 returned
So that seems to be the same error--maybe this will help someone else to resolve this problem.

Meteor command not found

I installed the same version from Official Windows Meteor Support on one computer and the command "meteor" runs normally, now I tried to install in another computer but is giving me the issue that the "meteor command was not found". I tried to add the path to the system variables, but it doesn't seem to work.
Any ideas? Thank you
I have just discovered in Windows (I am using Windows 8.1) that you have to type meteor.bat to invoke meteor. e.g. meteor.bat create myapp
The answers already listed were only half the answer for me.
The following steps, resolved the issue.
Set the SYSTEM Environment Variable to:
C:\Users\%username%\AppData\Local\.meteor
Or if you prefer, change to your username explicitly
C:\Users\rich\AppData\Local\.meteor
Then as per the accepted answer on this question.
Create a file named meteor in the directory where the meteor.bat is. E.g. the path above.
Hint, you can use
touch meteor
Copy these lines into the file and save
#!/bin/sh
cmd //c "$0.bat" "$#"
For others that might come across this issue.
I'm on Windows 10 and installed Meteor 1.4. Was getting meteor command not found when trying to run meteor from command prompt.
I checked my users PATH variables and found this entry:
C:\Users\%username%\AppData\Local\.meteor\
I removed the last backslash, saved the PATH variables, and then opened a new command prompt. The meteor command was now recognized.
My PATH variable entry now looks like this with the last backslash removed:
C:\Users\%username%\AppData\Local\.meteor
Note: You can replace %username% with your actual windows username. The entry should work fine as the system will resolve it to your username.
If path variable is not present in environment variables,
You can execute the command only from the directory where meteor is present. i.e., "C:\Users\username\AppData\Local.meteor\" directory.
To use the meteor from any directory inside the command prompt,
Add path variable to the environment settings.
"C:\Users\username\AppData\Local.meteor\meteor.bat".
Restart command prompt if already open.
This will enable meteor command to work everywhere.
The question is old but it might help others who face similar issue.
I just installed meteor and had the same issue. It looks like it installed successfully and added C:\Users\USERNAME\AppData\Local.meteor to the User variable (not system variable).
I am using Windows 10 and I might have to re-login or reboot for that to start working properly.
So, to use without re-login or reboot, use complete path in the directory where you want to create the project:
C:\Projects> C:\Users\USERNAME\AppData\Local.meteor\meteor my_project
Hope it helps.
Using the Node Command prompt instead of Terminal worked for me. Search for Node Command Prompt in the Start Menu.
On Linux,
If the problem comes from systemd service (systemclt) configuration, the PATH is not recognized properly, then:
Here is the error log:
Feb 3 00:13:43 localhost metassa-org[65870]: > meteor run --port=9999
Feb 3 00:13:43 localhost metassa-org[65881]: sh: 1: meteor: not found
Feb 3 00:13:43 localhost metassa-org[65870]: npm ERR! code 127
Feb 3 00:13:43 localhost metassa-org[65870]: npm ERR! path /var/www/domain.org/meteor/simple-todos-react
Feb 3 00:13:43 localhost metassa-org[65870]: npm ERR! command failed
Edit your service configuration file:
Environment="PATH=/home/ubuntu/.npm-global/bin:/home/ubuntu/.meteor:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$PATH"
Replace /home/ubuntu with your user folder containing meteor install.
You may replace all with your current $PATH value instead.
ExecStart=/usr/bin/npm run start --prefix /var/www/meteor/simple-todos-react
Modify /var/www/meteor/simple-todos-react with your meteor project
Finally, restart your service.
sudo systemctl daemon-reload

grunt clean fail unable to delete ".tmp" file (EPERM, operation not permitted)

When I built a yeoman angular app, when I run it for the first time it works fine using grunt serve but when i run it the second time an error from grunt clean task as following:
Cleaning .tmp...ERROR
Warning: Unable to delete ".tmp" file (EPERM, operation not permitted '...\.tmp'). Use --force to continue.
Aborted due to warnings.
When I delete the .tmp folder manually the app runs without errors.
I searched the net and here but I couldn't find a convincing answer.
Please advice,
I was able to fix this issue by updating the version of the rimraf node module inside of grunt-contrib-clean.
$ cd .\node_modules\grunt-contrib-clean
$ npm install rimraf#2.2.8
This looks like the commit in rimraf that fixed the issue: https://github.com/isaacs/rimraf/commit/1b612ed9370b5a3d0de9bb0ba1a32ea1dc8edba1
Was having a similar issue running "grunt build" from Mac. Issue turned out to be file permissions, to fix I did "sudo chmod -R ." on the root directory and it fixed the issue.
Check if any explorer of the directory you are trying to delete is open. If so, close the explorer and clean.
Try this simple solution(Sometimes problem might be due to empty folder). It works for me :
clean : {
dist : ['./dist'+'/**/*.*']
}
sudo chgrp -R username .tmp
sudo chown -R username .tmp

PCL execution error

I'm fairly new to the PCL and linux in general. I'm having trouble following the examples in documentation. None of the examples execute.The code compiles fine and a executable is generated. But I keep getting a permission denied error. The usual chmod and chown dont work. I've tried reinstalling PCL. What am I missing here ?
Here is the output from terminal https://www.dropbox.com/s/pjv8utctnokpihd/error.txt
From the dump you provide it looks like you are working in a mounted disk (/media/chaitanya/); possibly it was mounted with noexec or something. Try running mount to see.
Alternatively try working in your home directory:
cd ~
cp -r /media/chaitanya/work/learn-pcl/ ./
etc.

cant start mongodb strange behavior permission denied as root

Im running as root on a smartos64 machine.
My database is at /data/db
Mongod is at /mongo/bin/mongod
I get a 'permission denied' error with no further details when running either
- run ./mongo/bin/mongod or
- sudo ./mongo/bin/mongod
I tried changing permissions with chown on /data/db, but I still get this behaviour. How would I start mongo?
What build of Mongo did you download? I believe SmartOS64 is a derivative of Solaris, so I would try a Solaris build from the Mongo download site. If that doesn't work, you may want to build it from source.

Resources