最近把打卡团服务器从Rails6升级到了Rails 7。其中一个改动是,将webpacker改成esbuild。改动本身其实并不难,将jsbunding-rails和 cssbundling-rails 两个gem加到Gemfile里面。 然后执行各自的install task,照着网上的一些教程基本上就能搞定,这里不作详细的赘述。 在这个过程中,因为某个依赖不支持Node 15,于是升级到了node 16。但是在部署的时候,遇到一个问题,报了一个错: In file included from /home/username/.cache/node-gyp/16.13.2/include/node/v8.h:30:0, from /home/username/.cache/node-gyp/16.13.2/include/node/node.h:63, from ../../nan/nan.h:58, from ../src/binding.cpp:1: /home/username/.cache/node-gyp/16.13.2/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’: /home/username/.cache/node-gyp/16.13.2/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not…