opencollective / opencollective-cli

Command Line Interface for Open Collective
MIT License
17 stars 12 forks source link

npm install fails on Windows - resource busy or locked #8

Closed diakonos closed 6 years ago

diakonos commented 6 years ago

We use styled-components which includes this package as a dependency. It works fine when installing on my local machine (macOS), but when installing on our Azure App Service, I keep getting the following error:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})

npm ERR! path D:\home\site\wwwroot\node_modules\opencollective\dist\bin\opencollective.js.2403443982
npm ERR! code EBUSY
npm ERR! errno -4082
npm ERR! syscall rename
npm ERR! EBUSY: resource busy or locked, rename 'D:\home\site\wwwroot\node_modules\opencollective\dist\bin\opencollective.js.2403443982' -> 'D:\home\site\wwwroot\node_modules\opencollective\dist\bin\opencollective.js'

Other issues I was able to find with similar behavior pointed to running npm cache clean (https://github.com/MitocGroup/deep-framework/issues/273) or disabling anti-malware (https://github.com/npm/npm/issues/7370).

Running npm cache clean did not resolve the issue for me. I'm still looking into disabling anti-malware as a solution, but I'm not sure yet how to do it on Azure, and it seems like a less-than-ideal solution.

As a temporary measure, I've had to fork styled-components to remove the dependency, and installation works now. Wondering if anyone has encountered this or has any insights. Thanks!

xdamman commented 6 years ago

Sorry for the issue! We just published a new lightweight post install without any dependency. See https://github.com/opencollective/opencollective-cli/issues/3#issuecomment-378039208

Closing this issue for now but don't hesitate to reopen it or create a new one if you still run into some issues.