Thursday, April 30, 2015

Node Package Manager (npm) Complaining "Unknown Error" from Linux Guest on Windows Host

I ran a npm install on a Linux guest running inside a Windows host and received an "Unknown Error". The error message looks like the following,


npm http 200 https://registry.npmjs.org/mime-db/-/mime-db-1.8.0.tgz
npm ERR! Error: ENOENT, lstat '/foo/node_modules/sauce-tunnel/vendor/linux/bin/sc'
......
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
......
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /foo/node_modules/something/npm-debug.log
npm ERR! not ok code 0


The solution is to run the following,

npm cache clean
npm install --no-bin-links
The cause of these type of errors, apparently is that when we install a node package to a shared Windows directory on a Linux guest and the underlining Windows filesystem does not know how to handle the Linux/Unix links, according to the post here.

1 comment: