Working with the sandbox demo sample, I have opened and closed the file a few times between development runs and now even after a restart of my pc, I get the below error when trying to start the development server. I have tried stopping the server and killing all related processes on windows but I think this is a locked file issue?
npm error syscall rename
npm error path C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\helper
npm error dest C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\.helper-aycGCRWS
npm error errno -4082
npm error EBUSY: resource busy or locked, rename 'C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\helper' -> 'C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\.helper-aycGCRWS'
npm error A complete log of this run can be found in: C:\Users\Robert.Farthing\AppData\Local\npm-cache\_logs\2024-12-02T13_08_34_329Z-debug-0.log
The EBUSY: resource busy or locked error indicates that a file or resource is being accessed simultaneously by another process or is locked. Here are some steps to resolve this issue:
Ensure No Other Processes are Running:
Open the Task Manager on Windows and make sure that no other instances of npm, Node.js, or any related applications are still running that could hold the lock on the resource.
Delete node_modules and Reinstall:
Sometimes temporary issues with specific modules can cause locks. Deleting the node_modules folder and reinstalling dependencies might help. Use the following commands in your projectās root directory:
rm -rf node_modules
npm install
Use processExplorer:
Download and use Process Explorer from Sysinternals (available on Microsoftās website) to identify lock-holding processes and kill them if safe to do so.
Restart Your System:
Restarting your system can often solve transient file lock issues.
Check for System Updates:
Ensure your system, Node.js, and npm are updated to the latest stable versions. Conflicting environments or outdated versions might contribute to such problems.
Use a Different Directory:
Try executing the project from a different root directory to determine if the locking issue is path-specific.
If none of the above methods work, you can try resetting your npm cache with npm cache clean --force.
Lastly, ensure that your projectās setup aligns with Needle Engineās documentation precisely. Refer to the Needle Engine documentation for any specific setup instructions.
24 replies left thread_a3jc1KE4mn1RFUw2ItLj92s9 Reply to this message to continue the conversation
Pretty much what the bot says ā unfortunately this is an issue in Node.js itself that weāve also seen a couple times, where an installation is only partially completed and Node canāt recover on its own. Manually deleting node_modules should fix the issue.
Just tried that and clicked install development server again in Blender after reopening the file with all processes ended and after install I get the same error. Wondering what is causing the file to be locked suddenly after it successfully installs.
Do you maybe have some overly aggressive antivir software running? Iāve seen cases where these tend to grab ānewā files and then may go rogue with anything that changes many files at once (like, installing packages)
I do have some company managed antivirus installed. It never impacted package installs before luckily, I just deleted the node_modules folder again and this time instead of clicking āInstall Preview Serverā before clicking āStart Preview Serverā, I just clicked āStart Preview Serverā which seems to run the npm install then keeps the terminal open after and starts Vite and it runs fine now. Iāll keep an eye on the issue as it has happened a few times on different blend files to see if this process is the fix.
@marcel@Felix_Herbst I have reproduced this on 2 personal windows 11 devices that simply have Windows Defender running and no managed antivirus, the same error happens there about the @needle-tools/helper folder being marked as busy after running local server then stopping it and trying to start it again:
npm error errno -4082
npm error EBUSY: resource busy or locked, rename'C:\Users\Downloads\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\helper' -> 'C:\Users\Downloads\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\.helper-aycGCRWS'
npm error A complete log of this run can be found in: C:\Users\robye\AppData\Local\npm-cache\_logs\2024-12-02T13_08_34_329Z-debug-0.log
This is fully blocking me from using the Blender plugin currently. Blender version 4.3.0 on both machines and Needle Engine Exporter for Blender is 0.52.0 on both machines
I checked with Resource Monitor and couldnāt see anything locking the folder either
I have recorded what happens here, in one video I clear node modules then just try installing the Local Server and then try starting it. Same issue as before so then I delete node modules folder again and instead click āStart Local Serverā which allows it to install then run once. Once it is running if I click stop server then try running start server again, the same issue as before with the busy/locked Needle Helper folder.
In the other video I try opening a sample scene from scratch, making it generate a web project then install and run the local server. When I stop running the local server and start it again, I also get the error about the locked Needle Helper folder.
On my main work laptop where that file locked happesn everytime, I can only get the Needle Blender server to start by doing this:
Delete the Node Modules folder
Click Start Preview Server which installs it then runs it - (using the Install Preview server button then trying to Start the server after results in helper folder busy/locked).
If you stop the server then try to start it again, the folder is locked
It makes Needle Blender plugin a real pain to use on my work laptop lately
My workaround now is to rename the helper folder manually to the folder name in the error busy log e.g. .helper-SRr2S37w then the server can start again on the next time I start it
Actually ignore that - the issue wasnāt fixed until I manually installed the new addon version via the zip file in Blender addons rather than using the update dialogue on Blender start. Now the issue seems to be resolved in 0.52.1. Thanks for fixing as this was almost blocking me from using the Blender plugin for a while!
I didnāt notice any upgrade warning message and the addons menu said it was the correct version. Iāll test it on a spare laptop to see if the same happens there.