Problems with native modules about electron-builder HOT 19 CLOSED

Problems with native modules about electron-builder
 HOT 19
 CLOSED Техника

Recommend Projects

  • React photo

    React

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

Recommend Projects

  • React photo

    React

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

Recommend Projects

  • React photo

    React

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

This question is a bit older, I know. But some of the TypeScript compiler options mentioned here are not necessarily helpful to solve the question. For people searching rootDir or similar (like me), it may be helpful to clarify the mentioned and the solution-relevant options.

Emit all files into one single file

✅ Use outFile

❌ Don’t use out (deprecated)

If you want to to build to a destination directory, choose outDir. See compiler options for further infos.

Only emit files from a certain directory

✅ Use files/include/exclude in tsconfig

❌ Don’t use rootDir

The compiler finds all input files by

  • looking at file/include/exclude properties
  • following import statements
  • following ///<reference .. /> (should not matter so much anymore)

rootDir

rootDir controls the output directory structure alongside with outDir, it is not used to specify the compiler input. Its usage is (quote):

For every input file (i.e. a .ts/.tsx file) it needs to generate an matching output (a .js/.jsx file). To figure out the file path of the generated output file it will chop off the «rootDir» from the input, then prepend the «outDir» to it.

Consequently rootDir needs a directory that includes all your input sources from above, otherwise you get

error TS6059: File is not under ‘rootDir’ .. ‘rootDir’ is expected to contain all source files

If rootDir is omitted, the compiler automatically calculates a suitable directory by considering all input files at hand. So it doesn’t necessarily have to be set.

sourceRoot

This option is only relevant with sourcemaps/debugging and can be omitted for the scope of the question. It is used, when your sources files are at a different location at runtime than at design time. The compiler will adjust the paths to the sources in the sourcemap file to match the paths at runtime (compiler options).

Hope, that clarifies things a bit.

Я не думаю, что это идеальное решение для нашей проблемы, но это, по крайней мере, обходное решение.

Как мы и предполагали, проблема заключается в отсутствующих переменных окружения, если мы начнем с jenkins-ssh. Таким образом, мы создали скрипт, который запускает процесс сборки вручную и устанавливает все переменные среды, которые мы могли бы получить командой «printenv», если мы находимся в терминале mac, где процесс сборки работает без ошибок.

Таким образом, мой скрипт выглядит следующим образом:

#! /bin/sh
################################################################################
# starts build manually and sets environment variables manually before starting build
################################################################################
# first get environment-values with command "printenv" in terminal on the desired system, where build process runs
# then set all line outputs with starting "export "; some example lines as follows
export SHELL=/bin/bash
export TERM=xterm-256color
export MAVEN_OPTS=-Xms1024m -Xmx3g -XX:PermSize=1024m
export PATH=/opt/subversion/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
export CLASSPATH_SEP=:
export LANG=de_DE.UTF-8
export XPC_FLAGS=0x0
export XPC_SERVICE_NAME=0
export LESSCHARSET=latin1
export SHLVL=1
export HOME=/Users/exampleUser
export GIT_HOME=/usr/bin/
export TMP=/tmp
export LOGNAME=exampleUser
export CLASSPATH=
export GIT_SRC_HOME=/Users/exampleUser/git
export SECURITYSESSIONID=186a9
export _=/usr/bin/printenv

# now starts build
cd <path-To-App-Directory>
build -m

# if desired check if app is signed
#spctl --assess -vv "<path-to-build-application>"
#codesign --verify -vvvv "<path-to-build-application>"

Мы не знаем, какие строки нужны, но до тех пор, пока скрипт работает, все хорошо для нас.

Может быть, какой-то другой специалист может знать профессиональное решение нашей проблемы. До сих пор мы отмечаем это решение как правильный ответ.

We settled up our Jenkins-server with a mac slave, that runs on my local developer machine. It has been made to create application apps by electron/node.js.

[mac] [ExampleApp] Running shell script

[mac] + npm run dist-mac
[mac] 
[mac] > ExampleApp@1.3.3-beta dist-mac ../workspace/Example-App/ExampleApp
[mac] > build -m
[mac] 

[mac] Warning: "directories" in the root is deprecated, please specify in the "build"

[mac] Rebuilding native production dependencies for darwin:x64

[mac] Packaging for darwin x64 using electron 1.4.13 to ../ExampleApp-dist/mac

[mac] Signing app (identity: Developer ID Application: Example Company Name (ABCDEFGHIJKLMNOPQRSTUVWXYZ))
[mac] 

[mac] Error: spawn spctl ENOENT
[mac]     at exports._errnoException (util.js:1023:11)
[mac]     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
[mac]     at onErrorNT (internal/child_process.js:359:16)
[mac]     at _combinedTickCallback (internal/process/next_tick.js:74:11)
[mac]     at process._tickCallback (internal/process/next_tick.js:98:9)
[mac] From previous event:
[mac]     at MacPackager.sign (/usr/local/lib/node_modules/electron-builder/out/macPackager.js:253:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/macPackager.ts:81:26
[mac] From previous event:
[mac]     at /usr/local/lib/node_modules/electron-builder/src/macPackager.ts:81:10
[mac]     at Generator.next (<anonymous>)
[mac] From previous event:
[mac]     at MacPackager.pack (/usr/local/lib/node_modules/electron-builder/out/macPackager.js:173:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/packager.ts:210:22
[mac] From previous event:
[mac]     at Packager.doBuild (/usr/local/lib/node_modules/electron-builder/out/packager.js:335:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/packager.ts:151:38
[mac]     at Generator.next (<anonymous>)
[mac]     at runCallback (timers.js:651:20)
[mac]     at tryOnImmediate (timers.js:624:5)
[mac]     at processImmediate [as _immediateCallback] (timers.js:596:5)
[mac] From previous event:
[mac]     at Packager.build (/usr/local/lib/node_modules/electron-builder/out/packager.js:261:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/builder.ts:214:40
[mac]     at Generator.next (<anonymous>)
[mac] From previous event:
[mac]     at build (/usr/local/lib/node_modules/electron-builder/out/builder.js:63:21)
[mac]     at Object.<anonymous> (/usr/local/lib/node_modules/electron-builder/out/cli/build-cli.js:68:41)
[mac]     at Module._compile (module.js:571:32)
[mac]     at Object.Module._extensions..js (module.js:580:10)
[mac]     at Module.load (module.js:488:32)
[mac]     at tryModuleLoad (module.js:447:12)
[mac]     at Function.Module._load (module.js:439:3)
[mac]     at Module.runMain (module.js:605:10)
[mac]     at run (bootstrap_node.js:418:7)
[mac]     at startup (bootstrap_node.js:139:9)
[mac]     at bootstrap_node.js:533:3
[mac] 
[mac] npm ERR! Darwin 15.6.0
[mac] npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist-mac"
[mac] npm ERR! node v7.5.0
[mac] npm ERR! npm  v4.1.2
[mac] npm ERR! code ELIFECYCLE
[mac] npm ERR! ExampleApp@1.3.3-beta dist-mac: `build -m`
[mac] npm ERR! Exit status 255
[mac] npm ERR! 
[mac] npm ERR! Failed at the ExampleApp@1.3.3-beta dist-mac script 'build -m'.
[mac] npm ERR! Make sure you have the latest version of node.js and npm installed.
[mac] npm ERR! If you do, this is most likely a problem with the ExampleApp package,
[mac] npm ERR! not with npm itself.
[mac] npm ERR! Tell the author that this fails on your system:
[mac] npm ERR!     build -m
[mac] npm ERR! You can get information on how to open an issue for this project with:
[mac] npm ERR!     npm bugs ExampleApp
[mac] npm ERR! Or if that isn't available, you can get their info via:
[mac] npm ERR!     npm owner ls ExampleApp
[mac] npm ERR! There is likely additional logging output above.
[mac] 
[mac] npm ERR! Please include the following file with any support request:
[mac] npm ERR!     ../workspace/Example-App/ExampleApp/npm-debug.log

The funny part of it is, that if I connect manually by ssh from another machine to my local-machine an execute the «build -m»-function by terminal, then the build runs perfect and without errors.

What do I need to set in the preferences that it works also with Jenkins-SSH? Or why do I get his error only from Jenkins

Мы установили наш сервер Jenkins с подчиненным Mac, который работает на моей локальной машине разработчика. Это было сделано для создания приложений приложений с помощью electronic/node.js.

Дженкинс подключается к моей машине OS X через ssh и мое имя пользователя/пароль. Я вижу, что во время сборки наш каталог приложений создается и сохраняется на моей машине в указанном месте. (slave.jar, каталог рабочей области и т. д.).

Jenkins теперь сталкивается с ошибкой, как показано ниже, если начинается подписание кода:

[mac] [ExampleApp] Running shell script

[mac] + npm run dist-mac
[mac] 
[mac] > ExampleApp@1.3.3-beta dist-mac ../workspace/Example-App/ExampleApp
[mac] > build -m
[mac] 

[mac] Warning: "directories" in the root is deprecated, please specify in the "build"

[mac] Rebuilding native production dependencies for darwin:x64

[mac] Packaging for darwin x64 using electron 1.4.13 to ../ExampleApp-dist/mac

[mac] Signing app (identity: Developer ID Application: Example Company Name (ABCDEFGHIJKLMNOPQRSTUVWXYZ))
[mac] 

[mac] Error: spawn spctl ENOENT
[mac]     at exports._errnoException (util.js:1023:11)
[mac]     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
[mac]     at onErrorNT (internal/child_process.js:359:16)
[mac]     at _combinedTickCallback (internal/process/next_tick.js:74:11)
[mac]     at process._tickCallback (internal/process/next_tick.js:98:9)
[mac] From previous event:
[mac]     at MacPackager.sign (/usr/local/lib/node_modules/electron-builder/out/macPackager.js:253:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/macPackager.ts:81:26
[mac] From previous event:
[mac]     at /usr/local/lib/node_modules/electron-builder/src/macPackager.ts:81:10
[mac]     at Generator.next (<anonymous>)
[mac] From previous event:
[mac]     at MacPackager.pack (/usr/local/lib/node_modules/electron-builder/out/macPackager.js:173:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/packager.ts:210:22
[mac] From previous event:
[mac]     at Packager.doBuild (/usr/local/lib/node_modules/electron-builder/out/packager.js:335:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/packager.ts:151:38
[mac]     at Generator.next (<anonymous>)
[mac]     at runCallback (timers.js:651:20)
[mac]     at tryOnImmediate (timers.js:624:5)
[mac]     at processImmediate [as _immediateCallback] (timers.js:596:5)
[mac] From previous event:
[mac]     at Packager.build (/usr/local/lib/node_modules/electron-builder/out/packager.js:261:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/builder.ts:214:40
[mac]     at Generator.next (<anonymous>)
[mac] From previous event:
[mac]     at build (/usr/local/lib/node_modules/electron-builder/out/builder.js:63:21)
[mac]     at Object.<anonymous> (/usr/local/lib/node_modules/electron-builder/out/cli/build-cli.js:68:41)
[mac]     at Module._compile (module.js:571:32)
[mac]     at Object.Module._extensions..js (module.js:580:10)
[mac]     at Module.load (module.js:488:32)
[mac]     at tryModuleLoad (module.js:447:12)
[mac]     at Function.Module._load (module.js:439:3)
[mac]     at Module.runMain (module.js:605:10)
[mac]     at run (bootstrap_node.js:418:7)
[mac]     at startup (bootstrap_node.js:139:9)
[mac]     at bootstrap_node.js:533:3
[mac] 
[mac] npm ERR! Darwin 15.6.0
[mac] npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist-mac"
[mac] npm ERR! node v7.5.0
[mac] npm ERR! npm  v4.1.2
[mac] npm ERR! code ELIFECYCLE
[mac] npm ERR! ExampleApp@1.3.3-beta dist-mac: `build -m`
[mac] npm ERR! Exit status 255
[mac] npm ERR! 
[mac] npm ERR! Failed at the ExampleApp@1.3.3-beta dist-mac script 'build -m'.
[mac] npm ERR! Make sure you have the latest version of node.js and npm installed.
[mac] npm ERR! If you do, this is most likely a problem with the ExampleApp package,
[mac] npm ERR! not with npm itself.
[mac] npm ERR! Tell the author that this fails on your system:
[mac] npm ERR!     build -m
[mac] npm ERR! You can get information on how to open an issue for this project with:
[mac] npm ERR!     npm bugs ExampleApp
[mac] npm ERR! Or if that isn't available, you can get their info via:
[mac] npm ERR!     npm owner ls ExampleApp
[mac] npm ERR! There is likely additional logging output above.
[mac] 
[mac] npm ERR! Please include the following file with any support request:
[mac] npm ERR!     ../workspace/Example-App/ExampleApp/npm-debug.log

Самое смешное, что если я вручную подключаюсь по ssh с другой машины к моей локальной машине и выполняю функцию «build -m» на терминале, то сборка выполняется идеально и без ошибок.

Что мне нужно установить в настройках, чтобы он работал и с Jenkins-SSH? Или почему я получаю его ошибку только от Дженкинса

1 ответ

Я не думаю, что это идеальное решение для нашей проблемы, но это, по крайней мере, обходной путь.

Как мы и предположили, проблема в отсутствующих переменных окружения, если начинать с jenkins-ssh. Таким образом, мы сделали скрипт, который запускает процесс сборки вручную и устанавливает все переменные среды, которые мы могли бы получить с помощью команды «printenv», если мы находимся в терминале Mac, где процесс сборки выполняется без ошибок.

Таким образом, мой вызываемый скрипт выглядит, например, следующим образом:

#! /bin/sh
################################################################################
# starts build manually and sets environment variables manually before starting build
################################################################################
# first get environment-values with command "printenv" in terminal on the desired system, where build process runs 
# then set all line outputs with starting "export "; some example lines as follows
export SHELL=/bin/bash
export TERM=xterm-256color
export MAVEN_OPTS=-Xms1024m -Xmx3g -XX:PermSize=1024m
export PATH=/opt/subversion/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
export CLASSPATH_SEP=:
export LANG=de_DE.UTF-8
export XPC_FLAGS=0x0
export XPC_SERVICE_NAME=0
export LESSCHARSET=latin1
export SHLVL=1
export HOME=/Users/exampleUser
export GIT_HOME=/usr/bin/
export TMP=/tmp
export LOGNAME=exampleUser
export CLASSPATH=
export GIT_SRC_HOME=/Users/exampleUser/git
export SECURITYSESSIONID=186a9
export _=/usr/bin/printenv

# now starts build
cd <path-To-App-Directory>
build -m

# if desired check if app is signed
#spctl --assess -vv "<path-to-build-application>"
#codesign --verify -vvvv "<path-to-build-application>"

Мы не знаем, какие строки нужны, но пока скрипт работает, у нас все в порядке.

Может быть, какой-то другой специалист знает профессиональное решение нашей проблемы. До сих пор мы отмечаем это решение как правильный ответ.

9 Фев 2017 в 18:23

Дополнительно:  С этого устройства нельзя расплачиваться в магазинах через google play возможно на нем настроен root
Оцените статью
Master Hi-technology
Добавить комментарий