如何纠正在fixdeps.js中的Intern npm安装失败

尝试安装实验室testing框架时出现以下错误。 我已经尝试清除npmcaching,重新启动机器等错误说已存在的文件不存在。 这是否可能与我正在运行节点v0.11.13的事实? 我知道一些软件包不能用于.10.xx以上的任何内容。 或者,也许这是别的?

> intern@2.1.1 install C:\Program Files\nodejs\node_modules\intern > node support/fixdeps.js fs.js:755 return binding.symlink(preprocessSymlinkDestination(destination, type), ^ Error: EEXIST, file already exists 'C:\Program Files\nodejs\node_modules\intern\ node_modules\dojo' at Error (native) at Object.fs.symlinkSync (fs.js:755:18) at C:\Program Files\nodejs\node_modules\intern\support\fixdeps.js:27:6 at Array.forEach (native) at Object.<anonymous> (C:\Program Files\nodejs\node_modules\intern\support\f ixdeps.js:8:20) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:349:32) at Function.Module._load (module.js:305:12) at Function.Module.runMain (module.js:490:10) npm ERR! intern@2.1.1 install: `node support/fixdeps.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the intern@2.1.1 install script. npm ERR! This is most likely a problem with the intern package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node support/fixdeps.js npm ERR! You can get their info via: npm ERR! npm owner ls intern npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.2.9200 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "intern" npm ERR! cwd C:\Program Files\nodejs npm ERR! node -v v0.11.13 npm ERR! npm -v 1.4.9 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Program Files\nodejs\npm-debug.log npm ERR! not ok code 0 

问题的确是由于使用了节点0.11.13。 具体来说,在0.11.13节点的path模块工作中似乎存在一个错误。

在Intern的support/fixdeps.js脚本的顶部附近,使用path.join创build一个path:

 var expected = path.join(__dirname, '..', 'node_modules'); 

在testing系统(Windows 7,Node.js 0.11.13)上运行fixdeps.js时, __dirnameC:\开头。 但是, path.join返回的path以c:\ (小写C)开头。 这种情况下的差异导致稍后脚本中的path比较返回不正确的值。

fixdeps.js在Node.js 0.10.26下运行时, path.join不会更改驱动器号的大小写,并且脚本正确运行。