Proof-of-Stake-Cryptocurrency-generator icon indicating copy to clipboard operation
Proof-of-Stake-Cryptocurrency-generator copied to clipboard

Compilation doesn't work on Windows

Open HexaHash opened this issue 7 years ago • 18 comments

//Default shell in admin mod.

Microsoft Windows [version 10.0.16299.431] (c) 2017 Microsoft Corporation. Tous droits réservés.

C:\WINDOWS\system32>cd C:\Users\Hexa\Desktop\HexaHash-Crypto

C:\Users\Hexa\Desktop\HexaHash-Crypto>npm run generate

[email protected] generate C:\Users\Hexa\Desktop\HexaHash-Crypto node index.js


Welcome to Nxt clone Proof of Stake Cryptocurrency generator


? Name of the Blockchain (example: SuperCoin) HexaCoin ? Symbol of the coin (example: SPC) HXC ? Peer port (example: 6874) 3000 ? Testnet peer port (example: 5874) 3001 ? API server port (example: 6876) 3002 ? Website of the project (or a github) not now ? Version of NXT Clone Starter latest (may not be compatible with the generator)

  1. Cloning the nxt-clone-starter Repository cloned successfully

  2. Setting up the parameters Modified files: HexaCoin/src/java/nxt/Nxt.java Modified files: HexaCoin/src/java/nxt/Constants.java Modified files: HexaCoin/src/java/nxt/Constants.java Modified files: HexaCoin/src/java/nxt/Constants.java Modified files: HexaCoin/src/java/nxt/peer/Peers.java Modified files: HexaCoin/src/java/nxt/peer/Peers.java Modified files: HexaCoin/contrib/Dockerfile Modified files: HexaCoin/contrib/Dockerfile Modified files: HexaCoin/Wallet.url Modified files: HexaCoin/Wallet.url Modified files: HexaCoin/conf/nxt-default.properties Modified files: HexaCoin/conf/nxt-default.properties

  3. Copying assets, and genesis files

  4. Compiling, renaming complation files Modified files: HexaCoin/compile.sh, HexaCoin/jar.sh, HexaCoin/mac-release-package.sh, HexaCoin/package.sh, HexaCoin/release-package.sh, HexaCoin/start.sh, HexaCoin/stop.sh, HexaCoin/win-compile.sh, HexaCoin/win-package.sh, HexaCoin/win-release-package.sh An error occured { Error: Command failed: cp -R templates/favicon.ico HexaCoin/html/www/ 'cp' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) cause: { Error: Command failed: cp -R templates/favicon.ico HexaCoin/html/www/ 'cp' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) killed: false, code: 1, signal: null, cmd: 'cp -R templates/favicon.ico HexaCoin/html/www/' }, isOperational: true, killed: false, code: 1, signal: null, cmd: 'cp -R templates/favicon.ico HexaCoin/html/www/' } An error occured { Error: Command failed: rm -rf HexaCoin/html/www/img && cp -R templates/img HexaCoin/html/www/ 'rm' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) cause: { Error: Command failed: rm -rf HexaCoin/html/www/img && cp -R templates/img HexaCoin/html/www/ 'rm' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) killed: false, code: 1, signal: null, cmd: 'rm -rf HexaCoin/html/www/img && cp -R templates/img HexaCoin/html/www/' }, isOperational: true, killed: false, code: 1, signal: null, cmd: 'rm -rf HexaCoin/html/www/img && cp -R templates/img HexaCoin/html/www/' } An error occured { Error: Command failed: rm -rf HexaCoin/conf/data && cp -R templates/conf/data HexaCoin/conf/ 'rm' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) cause: { Error: Command failed: rm -rf HexaCoin/conf/data && cp -R templates/conf/data HexaCoin/conf/ 'rm' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) killed: false, code: 1, signal: null, cmd: 'rm -rf HexaCoin/conf/data && cp -R templates/conf/data HexaCoin/conf/' }, isOperational: true, killed: false, code: 1, signal: null, cmd: 'rm -rf HexaCoin/conf/data && cp -R templates/conf/data HexaCoin/conf/' } An error occured { Error: Command failed: cd HexaCoin && sh ./compile.sh 'sh' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) cause: { Error: Command failed: cd HexaCoin && sh ./compile.sh 'sh' n'est pas reconnu en tant que commande interne ou externe, un programme ex�cutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:282:12) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:947:16) at Socket.stream.socket.on (internal/child_process.js:368:11) at Socket.emit (events.js:182:13) at Pipe._handle.close [as _onclose] (net.js:598:12) killed: false, code: 1, signal: null, cmd: 'cd HexaCoin && sh ./compile.sh' }, isOperational: true, killed: false, code: 1, signal: null, cmd: 'cd HexaCoin && sh ./compile.sh' }

C:\Users\Hexa\Desktop\HexaHash-Crypto>

HexaHash avatar May 10 '18 10:05 HexaHash

Hello can you try with PowerShell instead of windows normal shell? otherwise I invite you to try with GitBash that should also work

sandoche avatar May 10 '18 13:05 sandoche

I have the same error on PowerShell & GitBash,

HexaHash avatar May 10 '18 17:05 HexaHash

Actually I just tested it in Windows and it doesn't work. Here are three solutions that I recommend:

  • Set up a docker image / docker-compose with ubuntu, npm, to run the command (if so please do a pull request)
  • Use Bash Ubuntu for windows 10 (haven't tested) - https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
  • Use Virtual box with Ubuntu, you can find ready made images here: https://www.osboxes.org/

sandoche avatar May 11 '18 07:05 sandoche

I have installed Cygwin before (because before this, cd doesn't work) and doesn't work.

HexaHash avatar May 11 '18 08:05 HexaHash

Hello I found a way or even two try this:

  1. Edit index.js go to line 207 and remove && sh ./compile.sh
  2. Install docker and run docker run -it --rm --name coin-generator -v "$PWD":/usr/src/app -w /usr/src/app node:8 npm run generate

Actually after the change (1) it may work with your different bash where the cd works. You can give a try! Let me know how it goes!

sandoche avatar May 15 '18 11:05 sandoche

Also at the end you will have to run win-compile.sh followed by run.bat for windows! Unlike what the generator will tell you (which is for unix/mac)

sandoche avatar May 15 '18 11:05 sandoche

I made an update to build for windows with docker, just run npm run generate:docker

sandoche avatar May 17 '18 09:05 sandoche

hello, In step 1 cause I work on windows, I've use win-compile.sh and then run.bat. when run win-cimpile.sh it runs in Git for windows and return "bash:javac:command not found", and also I have java JRE on my system I face this error when use run.bat "Java version in "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" is "" and in "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Run Time environment" is "" java not found,please install java JRE". how can I solve this?

setarehAf avatar May 26 '18 07:05 setarehAf

I guess you don't have the right Java version? You need Java 8 / JDK

sandoche avatar Jun 01 '18 09:06 sandoche

need some help with the latest step to generate a coin

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'generate' ] 2 info using [email protected] 3 info using [email protected] 4 verbose stack Error: spawn C:\Program Files\nodejs\node.exe ENOENT 4 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19) 4 verbose stack at onErrorNT (internal/child_process.js:407:16) 4 verbose stack at process._tickCallback (internal/process/next_tick.js:63:19) 5 verbose cwd B:\Cryptocurrency-generator 6 verbose Windows_NT 10.0.17134 7 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "generate" 8 verbose node v10.14.2 9 verbose npm v6.4.1 10 error path C:\Program Files\nodejs\node.exe 11 error code ENOENT 12 error errno ENOENT 13 error syscall spawn C:\Program Files\nodejs\node.exe 14 error enoent spawn C:\Program Files\nodejs\node.exe ENOENT 15 error enoent This is related to npm not being able to find a file. 16 verbose exit [ 1, true ]

What do I miss here , thanks in advanced

kippy100 avatar Dec 26 '18 11:12 kippy100

@kippy100

Please check if your npm, and node, commands are working well. Type npm -v and node -v and check it if works.

It looks like it's not in the path.

sandoche avatar Dec 28 '18 18:12 sandoche

ok i have checkt the above post > npm -v = 6.4.1 and node -v = v10.14.2 i did those commands with gitbash what you adviced to use , thanks in advanced so it seems to me that this path works right ?

kippy100 avatar Dec 29 '18 10:12 kippy100

Yes. Did you manage ?

sandoche avatar Jul 11 '19 12:07 sandoche

Hi.. I am use Win 10 and got this error when compile. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 72 errors

novayadi85 avatar Oct 08 '19 20:10 novayadi85

same error :( have the coin compiled, works on every other platform.

adi6409 avatar Jan 06 '21 12:01 adi6409

well I also have a problem when I want to generate a wallet on windows. $ bash win-release-package.sh VERSION not defined But version of what? What is wrong?

TomasTrnkaPLC avatar May 02 '21 15:05 TomasTrnkaPLC

Ok so I froze on this during the wallet creation.

` May 02, 2021 9:45:30 PM com.izforge.izpack.core.container.PlatformProvider provide INFO: Detected platform: windows,version=10.0,arch=x64,symbolicName=null,javaVersion=1.8.0_291 Loading C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt\conf\nxt-default.properties May 02, 2021 9:45:30 PM com.izforge.izpack.compiler.CompilerConfig addInfo INFO: Adding uninstaller Setting the installer information Setting the GUI preferences Adding langpack: eng Adding resource: flag.eng Adding langpack: fra Adding resource: flag.fra Adding langpack: deu Adding resource: flag.deu Adding langpack: ita Adding resource: flag.ita Adding langpack: jpn Adding resource: flag.jpn Adding langpack: spa Adding resource: flag.spa Adding langpack: dan Adding resource: flag.dan Adding langpack: ell Adding resource: flag.ell Adding langpack: cat Adding resource: flag.cat Adding langpack: nld Adding resource: flag.nld Adding langpack: fin Adding resource: flag.fin Adding langpack: swe Adding resource: flag.swe Adding langpack: prt Adding resource: flag.prt Adding langpack: pol Adding resource: flag.pol Adding langpack: rus Adding resource: flag.rus Adding langpack: ukr Adding resource: flag.ukr Adding langpack: hun Adding resource: flag.hun Adding langpack: slk Adding resource: flag.slk Adding langpack: ron Adding resource: flag.ron Adding langpack: msa Adding resource: flag.msa Adding langpack: nor Adding resource: flag.nor Adding langpack: chn Adding resource: flag.chn Adding langpack: srp Adding resource: flag.srp Adding langpack: ces Adding resource: flag.ces Adding langpack: kor Adding resource: flag.kor Adding langpack: glg Adding resource: flag.glg Adding resource: InfoPanel.info Adding resource: LicencePanel.licence Adding resource: Installer.image Adding resource: shortcutSpec.xml Adding resource: Unix_shortcutSpec.xml Adding resource: RegistrySpec.xml Adding panel: hellopanel :: Classname : com.izforge.izpack.panels.checkedhello.CheckedHelloPanel Adding panel: LicencePanel_1 :: Classname : com.izforge.izpack.panels.licence.LicencePanel Adding panel: InfoPanel_2 :: Classname : com.izforge.izpack.panels.info.InfoPanel Adding panel: TargetPanel_3 :: Classname : com.izforge.izpack.panels.target.TargetPanel Adding panel: ShortcutPanel_4 :: Classname : com.izforge.izpack.panels.shortcut.ShortcutPanel Adding panel: InstallPanel_5 :: Classname : com.izforge.izpack.panels.install.InstallPanel Adding panel: SimpleFinishPanel_6 :: Classname : com.izforge.izpack.panels.simplefinish.SimpleFinishPanel -> Fatal error : Source file SlavCoin.jar (C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt.\SlavCoin.jar) not found com.izforge.izpack.api.exception.CompilerException: Source file SlavCoin.jar (C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt.\SlavCoin.jar) not found at com.izforge.izpack.compiler.CompilerConfig.processFileChildren(CompilerConfig.java:1163) at com.izforge.izpack.compiler.CompilerConfig.addPacksSingle(CompilerConfig.java:828) at com.izforge.izpack.compiler.CompilerConfig.addPacks(CompilerConfig.java:724) at com.izforge.izpack.compiler.CompilerConfig.executeCompiler(CompilerConfig.java:342) at com.izforge.izpack.compiler.bootstrap.CompilerLauncher.main(CompilerLauncher.java:52) Caused by: java.io.FileNotFoundException: Source file SlavCoin.jar (C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt.\SlavCoin.jar) not found at com.izforge.izpack.compiler.CompilerConfig.processFileChildren(CompilerConfig.java:1096) ... 4 more

(tip : use -? to get the commmand line parameters)

`

TomasTrnkaPLC avatar May 02 '21 19:05 TomasTrnkaPLC

May 02, 2021 9:56:11 PM com.izforge.izpack.compiler.CompilerConfig processExecutableChildren INFO: Marked target file executable: ${INSTALL_PATH}/compact.sh May 02, 2021 9:56:11 PM com.izforge.izpack.compiler.CompilerConfig processExecutableChildren INFO: Marked target file executable: ${INSTALL_PATH}/sign.sh -> Fatal error : ../installer/setup.xml:189: C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt...\jre not found. com.izforge.izpack.api.exception.CompilerException: ../installer/setup.xml:189: C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt...\jre not found. at com.izforge.izpack.compiler.helper.AssertionHelper.parseError(AssertionHelper.java:74) at com.izforge.izpack.compiler.CompilerConfig.processFileSetChildren(CompilerConfig.java:996) at com.izforge.izpack.compiler.CompilerConfig.addPacksSingle(CompilerConfig.java:832) at com.izforge.izpack.compiler.CompilerConfig.addPacks(CompilerConfig.java:724) at com.izforge.izpack.compiler.CompilerConfig.executeCompiler(CompilerConfig.java:342) at com.izforge.izpack.compiler.bootstrap.CompilerLauncher.main(CompilerLauncher.java:52) Caused by: java.lang.Exception: C:\Users\Tomas\Desktop\SlavCoin\Slavcoin\nxt...\jre not found. at com.izforge.izpack.util.file.types.FileSet.getDirectoryScanner(FileSet.java:203) at com.izforge.izpack.c

TomasTrnkaPLC avatar May 02 '21 20:05 TomasTrnkaPLC