1、安装nodejs npm
yum -y install -d nodejs
yum -y install npm
2、查看版本
3、安装node模块
npm install odbc -g
npm install node-gyp
npm install node-pre-gyp
4、编译驱动
odbc路径:/usr/local/lib/node_modules/odbc
编译命令: cd /usr/local/lib/node_modules/odbc
执行 node-gyp configure build
编译过程中如果报错1:
解决办法:这种报错是因为nodejs和python版本不适配,根据报错,看看nodejs要的python那个版本,下载安装即可解决。
报错2:
解决办法:
node-pre-gyp configure rebuild
驱动路径: