0

So, I have an open issue at the oauthd repo: Issue but the activity in their issue list looks very sporadic.

I'm trying to execute "npm install -g oauthd" from a MINGW32 shell.
I'm being told by the console that I am doing that wrong.

abates@MACHINE /c/dev/tools
$ npm -v
1.4.28

abates@MACHINE  /c/dev/tools
$ npm install -g oauthd
npm ERR! Error: EBUSY, unlink 'C:\Users\abates\AppData\Roaming\npm\node_modules\
oauthd\node_modules\hiredis'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "oauthd"
npm ERR! cwd c:\dev\tools
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\abates\AppData\Roaming\npm\node_modules\oauthd\node_modul
es\hiredis
npm ERR! code EBUSY
npm ERR! errno 10

abates@MACHINE /c/dev/tools
$

I couldn't find any useful information about the "EBUSY, unlink..." error that seems to have triggered the crash.

K. Alan Bates
  • 3,104
  • 5
  • 30
  • 54
  • `EBUSY` on unlink means a file can't be deleted because it's in-use. Note that on UNIX, in-use files are allowed to be deleted (well, unlinked; they're then deallocated once no longer in use); this error is a Windowsism. – Charles Duffy Nov 04 '14 at 18:40
  • ...so, well, the obvious question is whether you're running any service, development tooling, etc. using Node. – Charles Duffy Nov 04 '14 at 18:41
  • ...it's _possible_ that you're just running install scripts nobody tested on Windows, but more likely that it is what it says it is, ie. content already in-use. – Charles Duffy Nov 04 '14 at 18:42
  • @CharlesDuffy I currently have a development node server running, but I've never had any problem installing node packages before with a running node process. I've got scheduled tasks firing in 3 minutes that require the server. I'll shut down as soon as they finish and attempt to install then – K. Alan Bates Nov 04 '14 at 18:58
  • no dice. confirmed EBUSY, unlink on "hiredis"; no redis server running, no node server running. – K. Alan Bates Nov 04 '14 at 19:01
  • *shrug*. The message still means what it says it means -- a thing can't be deleted because it's in-use. So, something is using it. If you're really unlucky, that thing is the installer and you have a previously-undetected Windows-only bug. Otherwise, I'd suggest looking at the tools from sysinternals to figure out what's running on your system and has that directory pen. – Charles Duffy Nov 04 '14 at 19:02

1 Answers1

2

To resolve the "EBUSY, unlink..." error, I upgraded node package manager to 2.1.6. The race condition was eliminated

Check your PATH.

Make sure that

C:\<install location of node>

loads before

\user\<user>\AppData\npm

$ cd C:\<install location of node>
$npm install npm@2.1.6
$npm -v
2.1.6

$npm install oauthd -g    
\

Edit

Note that for my particular installation task (oauthd), there are dependencies on hiredis and dtrace-provider that are failing to build on my machine.

My hunch is that it is ignoring the availability of MSBuild.exe in the PATH and trying to load my MSBuild location directly from the registry but the error descriptions do not lead one to a natural next step other than trial and error.

With that: Docker to the rescue.

docker@boot2docker:~$ docker run -d --name redis - p 6379:6379 dockerfile/redis
docker@boot2docker:~$ docker run -d --name oauthd -p 443:443 -p 6284:6284 -e oauthd_host_url=http://auth.domain:6284 --link redis:redis vinc/oauthd-instance

works like a champ. If you aren't using docker, you're doing it wrong.

K. Alan Bates
  • 3,104
  • 5
  • 30
  • 54
  • ===> Try this first <=== https://stackoverflow.com/questions/36566236/npm-install-error-code-ebusy-errono-4082/45757541#45757541 – sijo vijayan Aug 18 '17 at 13:14