我正在尝试在我的windows机器上设置doctorjs,以便使用vim的标记栏,但我认为这可能是一个node.js问题。我在跟踪this tutorial。即使在我设置了我的NODE_PATH之后,我仍然收到一个错误,声称需要设置它。会出什么问题呢?
下面是我的win7机器上的终端日志:
C:\Windows\system32>set NODE_PATH=C:\Users\JG\Desktop\new\doctorjs\lib\jsctags
C:\Windows\system32>node.exe C:\Users\JG\Desktop\new\doctorjs\bin\jsctags.js -h
'node.exe' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\system32>cd c:\Users\JG\Desktop\new\doctorjs
c:\Users\JG\Desktop\new\doctorjs>node.exe C:\Users\JG\Desktop\new\doctorjs\bin\j
sctags.js -h
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH envi
ronment variable instead.
at Function.<anonymous> (module.js:376:11)
at Object.<anonymous> (C:\Users\JG\Desktop\new\doctorjs\bin\jsctags.js:41:8)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
c:\Users\JG\Desktop\new\doctorjs>发布于 2011-12-05 21:18:27
在node.js 0.6.x中,删除了require.paths。如果我没记错的话,它从0.2.x开始就被弃用了。因此,问题不在于缺少NODE_PATH环境变量,而在于您正在运行的包/应用程序与Node0.6.x不兼容。正常的解决方案是在node.js 0.4.12中运行此应用程序。遗憾的是,没有用于Windows的受支持版本0.4.x。最好的办法是重写应用程序,这样就不再使用require.paths。
此外:不要启动像node.exe C:\Full\Path\Folder这样的应用程序,因为工作目录将是C:\。因此,做一些类似这样的事情:
C:\Full\Path\Folder> C:\node.js\bin\node.exe Folder.https://stackoverflow.com/questions/8384840
复制相似问题