使用纱线,您可以通过设置
# ./.yarnrc --modules-folder /opt/myproject/node_modules
看见 https://www.caxy.com/blog/how-set-custom-location-nodemodules-path-yarn