When I try to install a node version with asdf-vm, I get the following error message:
Trying to update node-build... ok
mkdir: cannot set permissions '/tmp': Permission denied
node-build: TMPDIR=/tmp is set to a non-accessible location
Try setting TMPDIR to some directory that the installer can write to (it's running as you so anywhere you can write to should work).
For example: export TMPDIR=~/tmp/.
You may also want to report this issue to the maintainers of the asdf-nodejs plugin as the temp dir logic should work out of the box on all supported systems.
I've been developing an Electron app for Linux. The problem is: I can't execute an instruction because of this:
Error: socket: Operation not permitted
This might mean it needs sudo permissions. But since it is a desktop app, and I want to avoid this when I'll distribute it, is there a way to bypass this error, to execute it without sudo or automatically use it, in both development and production mode? If not, can I write a message which says it requires admin execution when I open its AppImage?
#crimson589
If I run dev mode with sudo npm run electron:serve it returns Error: Failed to get 'appData' path. If I run the AppImage with sudo, it works.
I have downloaded version 12 of nodeJs, but unable to install on Windows.
Error - "The installer has encountered an unexpected error installing this package.
This may indicate a problem with this package.The error code is 2203".
I have tried some solutions like giving permissions to Temp folder in C:/Windows folder, running as Admin although the usual user has full permissions.
Error code 2203 basically pops up when the user does not have
sufficient permissions to install the program to the folder that
contains the installation point or the temp folder. Make sure that you
are logged in as an Administrator to install the programs on the
computer
Run installation with elevated permission ( try to run a program with admin privilege). This should solve the issue.
I am running a nodejs app inside electron. The nodejs app writes logs to a log file that sits in a same installed path of the app.
I then use electron builder to build an installer. On a windows machine when I install the application under C:\Users\username, the nodejs app writes logs to the log file without any issue. But the problem arises when the app is installed under C:\Program Files\MyApp, the app shows the following error:
Error: EPERM: operation not permitted, open 'C:\Program
Files\MyApp\resources\app.asar.unpacked\server\logs\output.log'
However if I run the app as an administrator then it works perfectly. This clearly is a permission issue. How do I make my app write to the log in the above mentioned path without any admin privileges?
Thanks in advance.
Windows does not provide permission to write to Program Files directory unless you have administrator privileges. Either you have to force user to run you program as administrator or write logs to a folder like C:\Users\<username>\AppData\Local\<yourappname> as most applications does
Its better to store the logs somewhere in
path.join(app.getPath('userData'),'logs');
https://github.com/electron/electron/blob/master/docs/api/app.md#appgetpathname
I get this error in my app:
Error: EPERM: operation not permitted, open 'C:\Program Files
(x86)\Full Menu\db\main.json'
The app I have is built with electron-boilerplate. I am using this function to get the path to the root of the app:
path.dirname(process.execPath)
And this is the script that writes the file:
fs.writeFile(apath + '/db/' + elem + '.json', JSON.stringify(results)
I know what the problem is: permissions. But how could I get this working without running the app as an administrator?
For the benefit of searchers; I has this error. I added full permissions for Everyone as a test, but that didn't fix it. The issue was that the file was set to readonly (by source control).
Unchecking the readonly option in the file properties fixed the issue.
On my Windows 10 machine, I encountered this error when running an old Node JS project. I think Node version 10.16.
In any case, it was trying to modify a dotfile in my project. Be sure that the file isn't hidden on Windows. After unchecking the hidden option in the file properties pop up. Everything worked.
So to fix:
Right click file in Windows Explorer
Select properties
Uncheck Hidden
Click Ok
Re-run your command.
If you have the file that you can't open or modify mounted as a volume in docker restarting docker should fix the issue.
i had to run the node command prompt as administrator and that fixed the issue.
I face this issue when I was deleting a file/folder.
Solution:
Just restart your code editor/ terminal
Or
Restart your computer
If you are facing this issue on Windows 10, then please try the following:
Uncheck readonly options for the folder (if read-only reverts, login as administrator)
Open terminal as administrator (if you are facing this issue on terminal)
Switch off ransomware folder protection
Change chmod of the folder
Check if the folder is hidden or not
Disable antivirus protection (temporarily) and try this
Or move your project folder somewhere else, where antivirus ransomware protection is disable.
If nothing above works, then try the following:
https://appuals.com/how-to-fix-folder-keeps-reverting-to-read-only-on-windows-10/.
Hope this would of help.
I think that you must change the permissions recursively to the file so the user executing your script can read / write this file.
https://fr.wikipedia.org/wiki/Chmod
Restarting my computer fixed this problem for me.
I had this issue too. I'm using TFS (or VSO, Azure DevOps, etc.) for source control. I was trying to compile from .scss to .css and it couldn't open my .css. I just needed to right-click on my .css file and Check Out for Edit...
I had the error because i have already open the file before
var stream = fs.createWriteStream(outputFileName, {flags:'a'})
var output = fs.createWriteStream(outputFileName, {flags:'a'})
this is not an exact answer but may help:
i think if you want to read or readSync a file that doesn't exist you will encounter an EPERM error...
in many programming languages, any permission related error may not
directly means an actual permission issue
for example in PHP Folders (not files) must delete by php rmdir() method but if you want to do that with unlink() , u will encountered with a wrong Warning message that says "permission denied"
I was facing the same problem using the following software:
Windows 10
GitBash
Node v19
I was able to solve it opening GitBash as admin
I had the same problem, when i tried to create and write to a file using NodeJS. I thought it had to do with my windows file/folder access permissions, but after restarting my computer and running the code again, I still got the same error.
However, this time around my antivirus gave me a pop-up message also, stating that it blocked permission for Node.exe to write or open files. So once I flagged Node.exe as safe for my anti-virus program (Avast).
It worked for me. Disabling my antivirus could've also temporarily fixed it, I guess.
If you use windows 10, you must turn off Ransomware protection. Ransomware protection will prevent all folder and file changes.You can turn off it in Windows Security Center. See screenshot below: