我已经建立了一个电子应用程序,使用tensorflow和opencv 4 nodejs。
当我使用npm start
时,这个应用程序运行得很好。但是,当我试图构建我的应用程序时,它却突然出现了以下错误:
这里的问题是我没有从源代码构建opencv 4 nodejs,而是手动安装了opencv,然后禁用自动构建来为我的应用程序安装它。
从错误中,我看到它正在opencv-build下查找lib目录,但它根本不在那里。
有没有办法不重建任何东西,因为我已经有了所有的模块为Windows 10?
我相信这是一些简单的事情,但已经碰到了一堵砖墙。
这是我的包裹。
{
"name": "myApp",
"version": "0.0.1",
"description": "My Electron App",
"main": "main.js",
"license": "abc",
"private": true,
"scripts": {
"postinstall": "install-app-deps",
"start": "electron .",
"build": "electron-packager . nGage --platform win32 --arch x64 --out dist/ --icon image/nGage-Icon.ico --overwrite",
"setup": "electron-installer-windows --src dist/nGage-win32-x64/ --dest dist/installers/ --config config.json --overwrite",
"dist": "build"
},
"build": {
"appId": "com.electron.app",
"publish": [
{
"provider": "generic",
"url": "abc"
}
],
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
}
],
"certificateFile": "cert/abc",
"certificatePassword": "xyz"
},
"asar": false,
"nsis": {
"oneClick": true,
"perMachine": false,
"artifactName": "${productName}-Setup-${version}-x64.${ext}"
}
},
"author": {
"name": "ABC",
"email": "xyz@abc.com",
"url": "www.abc.com"
},
"devDependencies": {
"electron": "^9.0.3",
"electron-builder": "^19.53.6",
"electron-installer-windows": "^0.2.0",
"electron-packager": "^8.5.2",
"electron-winstaller": "^2.5.2",
"grunt-electron-installer": "^2.1.0"
},
"dependencies": {
"@tensorflow/tfjs": "^2.0.0",
"@tensorflow/tfjs-node": "^2.0.0",
"auto-launch": "^5.0.1",
"cron": "^1.2.1",
"electron-config": "^0.2.1",
"electron-positioner": "^3.0.0",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^2.19.0",
"electron-window": "^0.8.1",
"graceful-fs": "^4.1.11",
"homedir": "^0.6.0",
"https": "^1.0.0",
"opencv4nodejs": "^5.6.0",
"request": "^2.88.2",
"url": "^0.11.0",
"username": "^3.0.0",
"util": "^0.12.3",
"windows-build-tools": "^5.2.2"
}
}
“任何见解都是最有帮助的!
谢谢你,阿伦
1条答案
按热度按时间n6lpvg4x1#
因此我意识到在执行
npm run build
之前需要设置以下环境变量因为我在构建
opencv4nodejs
时使用了它们。`
`