Closed HSunboy closed 7 years ago
执行require.resolve会设置模块查找中的stat.cache缓存,从而导致在同一node进程中,即使下文安装了指定模块,也无法找到指定的模块。因此使用子进程来防止设置当前进程的stat.cache。详见: https://github.com/nodejs/node/issues/12695
require.resolve
stat.cache
执行
require.resolve
会设置模块查找中的stat.cache
缓存,从而导致在同一node进程中,即使下文安装了指定模块,也无法找到指定的模块。因此使用子进程来防止设置当前进程的stat.cache
。详见: https://github.com/nodejs/node/issues/12695