7k网站怎么做,wordpress国内能用吗,南昌网站seo公司,中国网警中心官网跑 jekins任务的服务器不能连接外网下载依赖包#xff0c;就将本地下载的 node_modules直接上传到服务器上#xff0c;但是运行时node-sass模块报错了ERROR in Missing binding /root/component/node_modules/node-sass/vendor/linux-x64-48/binding.node 报错信息类… 跑 jekins任务的服务器不能连接外网下载依赖包就将本地下载的 node_modules直接上传到服务器上但是运行时node-sass模块报错了ERROR in Missing binding /root/component/node_modules/node-sass/vendor/linux-x64-48/binding.node 报错信息类似这样 原因分析
报错信息说 binding.node文件与当前系统环境不匹配。 node-sass模块安装时会有根据当前的系统环境下载对应的 binding.node文件在 /node_modules/node-sass/vendor/目录下。本地开发一般是 windows 或者 macos系统而服务器是 linux系统所以本地下载的 node_modules中没有 linux对应的 binding.node文件直接搬运到服务器上运行就会报错。 node-sass文件目录类似这样 解决方法
鉴于这台服务器不能连接外网无法重新下载依赖包只能手动在/node_modules/node-sass/vendor/目录下上传跟当前 linux环境匹配的binding.node文件。
可以到 github上去下载对应版本的 binding.node文件按照指定的目录结构上传到服务器上 github地址 https://github.com/sass/node-sass/releases我们这台服务器上还有其他前端项目也用到相同版本的node-sass插件我就直接到这些前端项目的 node_modules下把 binding.node文件拷贝过来用了