electron 你到底是如何制作32位版本的电子应用程序

gtlvzcf8  于 2022-12-08  发布在  Electron
关注(0)|答案(1)|浏览(257)

我知道这看起来是一个非常基本和简单的问题,但我不确定正确的答案是什么。因为在某些情况下,我会得到一堆相互矛盾的答案。这里有一个简单的答案

electron-forge make --arch=ia32

这给了我以下错误,我不知道应该怎么解决-这是节点全局变量的标准编译点:

An unhandled error has occurred inside Forge:
An error occured while making for target: squirrel
Failed with exit code: 1
Output:
Attempting to build package from 'controller.nuspec'.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Error: Failed with exit code: 1
Output:
Attempting to build package from 'controller.nuspec'.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    at ChildProcess.<anonymous> (C:\Users\range\AppData\Roaming\npm\node_modules\electron-forge\node_modules\electron-winstaller\lib\spawn-promise.js:62:16)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

我终于得到的东西工作,现在马迎接这个错误:

但是我在这里安装了它(my package.json)

{
    "name": "controller",
    "productName": "controller",
    "version": "1.0.0",
    "description": "My Electron application description",
    "main": "src/index.js",
    "scripts": {
        "start": "electron-forge start",
        "package": "electron-forge package",
        "make": "electron-forge make",
        "publish": "electron-forge publish",
        "lint": "echo \"No linting configured\""
    },
    "keywords": [],
    "author": {
        "name": "----------",
        "email": "------------"
    },
    "license": "MIT",
    "config": {
        "forge": {
            "packagerConfig": {},
            "makers": [{
                    "name": "@electron-forge/maker-squirrel",
                    "config": {
                        "name": "controller"
                    }
                },
                {
                    "name": "@electron-forge/maker-zip",
                    "platforms": [
                        "darwin"
                    ]
                },
                {
                    "name": "@electron-forge/maker-deb",
                    "config": {}
                },
                {
                    "name": "@electron-forge/maker-rpm",
                    "config": {}
                }
            ]
        }
    },
    "dependencies": {
        "electron-squirrel-startup": "^1.0.0"
    },
    "devDependencies": {
        "@electron-forge/cli": "^6.0.0-beta.57",
        "@electron-forge/maker-deb": "^6.0.0-beta.57",
        "@electron-forge/maker-rpm": "^6.0.0-beta.57",
        "@electron-forge/maker-squirrel": "^6.0.0-beta.57",
        "@electron-forge/maker-zip": "^6.0.0-beta.57",
        "electron-prebuilt-compile": "8.2.0"
    }
}

我还尝试安装编译器等-这给了我这个错误

Electron forge was terminated:
You must depend on an EXACT version of "electron-prebuilt-compile" not a range (got "^8.2.0")

https://github.com/electron-userland/electron-forge/issues/171
下一个我尝试的是从这个线程:https://github.com/HospitalRun/hospitalrun-frontend/issues/1074,它告诉我:

npm ERR! missing script: electron:build

尽管安装了NPM电子
这是怎么回事?

jvidinwx

jvidinwx1#

根据这个GitHub问题,项目被嵌套在太多的文件夹中。尝试将项目移到机器的根目录下,然后从那里创建构建。
以下资源说明了为什么这在Windows上受到限制

相关问题