egg项目加入egg-xtransit运行报错
shun199912 opened this issue · 20 comments
2022-09-01 14:32:08,841 ERROR 29308 nodejs.ERR_DLOPEN_FAILEDError: [egg-core] load file: C:\Users\admin\Desktop\study\communication\node_modules\egg-xtransit\agent.js, error: The specified procedure could not be found.
\\?\C:\Users\admin\Desktop\study\communication\node_modules\xprofiler\build\binding\Release\node-v93-win32-x64\xprofiler.node
\\?\C:\Users\admin\Desktop\study\communication\node_modules\xprofiler\build\binding\Release\node-v93-win32-x64\xprofiler.node
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1168:18)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (C:\Users\admin\Desktop\study\communication\node_modules\xprofiler\xprofiler.js:16:19)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
code: "ERR_DLOPEN_FAILED"
name: "ERR_DLOPEN_FAILEDError"
pid: 29308
应该是非 win10 的兼容问题,install 的时候带上 --build-from-source
走本地编译吧
windows 我只在 win10 的 x64 下测试了兼容性
还是不可以 用npm install egg-xtransit --build-from-source 之后再次用npm run dev 还是启动不起来
你要删掉 node_module 重新安装
npm i --build-from-source
好的 我试试
我先安装一下python
需要搭建一个编译环境,除了 python,还需要安装 visual studio 的 desktop 套件
预编译好的 dll 在 win11 不兼容我这里就比较难判断,因为没有环境变量可以判断是不是 win11,只能判断是不是 windows,这个回头还得研究下
不过有个小问题 我用的是Windows10 64为开发的啊
你的 win10 是哪个版本的?
windows10 家庭中文版
版本号21H2
这就比较奇怪了,是不是你 install 的不完整,试下 npm install xprofiler --save --xprofiler_binary_host_mirror=https://npmmirror.com/mirrors/xprofiler
然后写个 js 文件简单 require('xprofiler').start()
看看会不会报错
我最开始用的是npm install xprofiler --save --xprofiler_binary_host_mirror=https://npmmirror.com/mirrors/xprofiler 后来用的是npm install
清空了 node_module 之后用npm install 之后会报出来一堆python的错
应该是环境的原因我让其他人用跑了一下就没问题 对了 有群吗 我看钉钉的群地址过期了
先用钉钉群号搜索吧:35149528 ,二维码我稍后更新下
好的
已经解决了这个 issue 我先关闭了,有需要可以继续提