Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation of the Twokeys server fails #15

Closed
codemicro opened this issue Jun 25, 2019 · 23 comments
Closed

Installation of the Twokeys server fails #15

codemicro opened this issue Jun 25, 2019 · 23 comments
Labels
bug Something isn't working

Comments

@codemicro
Copy link
Contributor

codemicro commented Jun 25, 2019

When running npm install --global twokeys-server during the setup as documented in SETUP.md, I end up with this:

Warning: Missing input files:
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\..\src\cpp\current-dir.cc
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\..\src\cpp\main.cc
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\..\src\cpp\run-ahk.cc
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\..\src\cpp\convert.cc
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  main.cc
  run-ahk.cc
  current-dir.cc
  convert.cc
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\run-ahk.cc': No such file or directory [C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\twokeys.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\main.cc': No such file or directory [C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\twokeys.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\convert.cc': No such file or directory [C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\twokeys.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\current-dir.cc': No such file or directory [C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build\twokeys.vcxproj]
  win_delay_load_hook.cc
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! twokeys-server@0.3.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the twokeys-server@0.3.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Any help would be much appreciated.

Also - because I already had Python 3.7 installed and in my PATH variables, the installer was attempting to use that, causing a syntax error.

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Hello there,
So by the looks of things, the way it's locating the files to compile isn't working correctly:

Warning: Missing input files:
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build..\src\cpp\current-dir.cc
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build..\src\cpp\main.cc
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build..\src\cpp\run-ahk.cc
C:\Users\thoma\AppData\Roaming\npm\node_modules\twokeys-server\build..\src\cpp\convert.cc

I'm going to try spinning up a Windows Docker container and trying to install myself to see if I can replicate the issue.

@codemicro
Copy link
Contributor Author

Awesome - it's also worth noting I'm following some of the suggestions in nodejs/node-gyp#119 for the other error, but that is persisting too.

@Gum-Joe Gum-Joe added the bug Something isn't working label Jun 25, 2019
@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Ok, so upon running the container, I get an entirely different error when running npm install --global windows-build-tools.
Unfortunately, I have some work to do, so I'll have to look into this later.

In the meanwhile, I would like to just kindly confirm: you are Python 2.7? And when you run python --version in a terminal it confirms you are running Python 2.7?

If you want to, you can optionally try building the 2Keys server from scratch:

  1. Clone the Git repo
  2. In the repo root, run:
cd server
yarn
  1. Please then post the result here

BTW, you're using the same version of node-gyp as I am, though I guess you could also try updating node-gyp if you wanted:
npm install --global node-gyp@latest

@codemicro
Copy link
Contributor Author

codemicro commented Jun 25, 2019

Yeah - I sorted the Python issue before I opened this issue. I (have three versions of Python on this machine, 3.7x64, 3.7x32 and 2.15. I had a PATH variable set to one of the 3.7 versions, which was causing issues during installation so I replaced that variable with one for Python 2, which worked.

Here's the output from Yarn:

c:\2keys\server>yarn
yarn install v1.16.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | win32 | x64
gyp info spawn C:\Users\thoma\.windows-build-tools\python27\python.EXE
gyp info spawn args [ 'c:\\2keys\\server\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'c:\\2keys\\server\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'c:\\2keys\\server\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\thoma\\.node-gyp\\10.16.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\thoma\\.node-gyp\\10.16.0',
gyp info spawn args   '-Dnode_gyp_dir=c:\\2keys\\server\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\thoma\\.node-gyp\\10.16.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=c:\\2keys\\server',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'c:\\2keys\\server\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  main.cc
  run-ahk.cc
  current-dir.cc
  convert.cc
  win_delay_load_hook.cc
c:\2keys\server\src\cpp\convert.cc(34): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [c:\2keys\server\build\twokeys.vcxproj]
  c:\users\thoma\.node-gyp\10.16.0\include\node\v8.h(2891): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
c:\2keys\server\src\cpp\main.cc(68): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [c:\2keys\server\build\twokeys.vcxproj]
  c:\users\thoma\.node-gyp\10.16.0\include\node\v8.h(2891): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
c:\2keys\server\src\cpp\main.cc(73): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [c:\2keys\server\build\twokeys.vcxproj]
  c:\users\thoma\.node-gyp\10.16.0\include\node\v8.h(2891): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
     Creating library c:\2keys\server\build\Release\twokeys.lib and object c:\2keys\server\build\Release\twokeys.exp
  Generating code
  All 179 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  twokeys.vcxproj -> c:\2keys\server\build\Release\\twokeys.node
gyp info ok
Done in 15.82s.

How do I then run the server from this?

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

if you run yarn link it should place 2Keys in the path. However, it means you won't be able to get any updates (I may be getting around soon to issuing some updates soon), but it'll let you run the server

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

(not regarding the from scratch install you just did) By the looks of things, the global installer is causing a problem. Try running yarn global add twokeys-server (btw untested myself) instead of npm install --global twokeys-server

@codemicro
Copy link
Contributor Author

I ran both yarn link and yarn global add twokeys-server. This is the output.

c:\2keys\server>yarn link
yarn link v1.16.0
success Registered "twokeys-server".
info You can now run `yarn link "twokeys-server"` in the projects where you want to use this package and it will be used instead.
Done in 0.26s.

c:\2keys\server>yarn global add twokeys-server
yarn global v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server
Output:
C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | win32 | x64
gyp info spawn C:\Users\thoma\.windows-build-tools\python27\python.EXE
gyp info spawn args [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\thoma\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\twokeys-server\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\thoma\\.node-gyp\\10.16.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\thoma\\.node-gyp\\10.16.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\thoma\\.node-gyp\\10.16.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\thoma\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\twokeys-server',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\thoma\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\twokeys-server\\build',
gyp info spawn args   '-Goutput_dir=.' ]
Warning: Missing input files:
C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\..\src\cpp\current-dir.cc
C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\..\src\cpp\convert.cc
C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\..\src\cpp\main.cc
C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\..\src\cpp\run-ahk.cc
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  main.cc
  run-ahk.cc
  current-dir.cc
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\main.cc': No such file or directory [C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\twokeys.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\run-ahk.cc': No such file or directory [C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\twokeys.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\current-dir.cc': No such file or directory [C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\twokeys.vcxproj]
  convert.cc
c1xx : fatal error C1083: Cannot open source file: '..\src\cpp\convert.cc': No such file or directory [C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server\build\twokeys.vcxproj]
  win_delay_load_hook.cc
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\thoma\AppData\Local\Yarn\Data\global\node_modules\twokeys-server
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

When then running twokeys, I get an error from Node.

c:\2keys\server>2keys
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '../lib/index'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (c:\2keys\server\bin\2Keys:21:15)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Right, so by the looks of things the issues with the global installer are that the source files aren't being packaged with the application, so I'll need to go and investigate that.

For the from scratch install, could you run dir and dir lib in c:\2keys\server please?

@codemicro
Copy link
Contributor Author

c:\2keys\server>dir
 Volume in drive C is OS
 Volume Serial Number is E653-0874

 Directory of c:\2keys\server

25/06/2019  19:26    <DIR>          .
25/06/2019  19:26    <DIR>          ..
24/12/2018  15:01             1,212 .npmignore
24/12/2018  15:01    <DIR>          assets
24/12/2018  15:01    <DIR>          bin
24/12/2018  15:01               299 binding.gyp
25/06/2019  19:26    <DIR>          build
24/12/2018  15:01            35,149 LICENSE
25/06/2019  19:26    <DIR>          node_modules
24/12/2018  15:01            75,895 package-lock.json
24/12/2018  15:01             1,153 package.json
24/12/2018  15:01             1,831 README.md
24/12/2018  15:01    <DIR>          src
24/12/2018  15:01    <DIR>          test
24/12/2018  15:01             5,359 tsconfig.json
24/12/2018  15:01               330 tslint.json
24/12/2018  15:01            54,568 yarn.lock
               9 File(s)        175,796 bytes
               8 Dir(s)  116,138,450,944 bytes free

c:\2keys\server>dir lib
 Volume in drive C is OS
 Volume Serial Number is E653-0874

 Directory of c:\2keys\server

File Not Found

@codemicro
Copy link
Contributor Author

Ah - can you confirm what you mean by from scratch? I assume you mean from the source?

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Ah yes, sorry, scratch = source. I really should be saying "from source"!

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Ah, It appears I forgot to tell you to also build the typescript source (src) 🤦‍♂
I think you just need to run yarn run tsc

@codemicro
Copy link
Contributor Author

It failed.

c:\2keys\server>yarn run tsc
yarn run v1.16.0
$ c:\2keys\server\node_modules\.bin\tsc
src/init/daemon.ts:110:27 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
110   const VBS_SCRIPT = join(process.env.APPDATA, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", `${WINDOWS_DAEMON_PREFIX}${name}.vbs`);                                     ~~~~~~~~~~~~~~~~~~~

src/init/get-config.ts:92:15 - error TS2339: Property 'push' does not exist on type 'Questions<Answers>'.
  Property 'push' does not exist on type 'Question<Answers>'.

92     questions.push({
                 ~~~~
src/init/get-config.ts:100:15 - error TS2339: Property 'push' does not exist on type 'Questions<Answers>'.
  Property 'push' does not exist on type 'Question<Answers>'.
100     questions.push({
                  ~~~~

src/init/get-config.ts:127:26 - error TS2339: Property 'push' does not exist on type 'ReadonlyArray<Question<Answers>>'.
127       questions_keyboard.push({
                             ~~~~
                                                                               src/init/get-config.ts:133:26 - error TS2339: Property 'push' does not exist on type 'ReadonlyArray<Question<Answers>>'.
133       questions_keyboard.push({                                                                         ~~~~
                                                                               src/init/get-config.ts:168:40 - error TS2538: Type 'undefined' cannot be used as an index type.
168         const name = answers_keyboards[keyboard_q.name]; // Get answer user provided for name
                                           ~~~~~~~~~~~~~~~

src/init/get-config.ts:175:50 - error TS2538: Type 'undefined' cannot be used as an index type.

175         current_keyboard_dir = answers_keyboards[keyboard.name];
                                                     ~~~~~~~~~~~~~
                                                                               src/init/get-config.ts:177:26 - error TS2538: Type 'undefined' cannot be used as an index type.

177         config.keyboards[current_keyboard_name] = {                                                     ~~~~~~~~~~~~~~~~~~~~~
                                                                               src/oobe/index.ts:55:9 - error TS2454: Variable 'config' is used before being assigned.

55     if (config.oobe && !argv.force) {
           ~~~~~~
src/oobe/index.ts:64:7 - error TS2454: Variable 'config' is used before being assigned.
                                                                               64       config.oobe = true;
         ~~~~~~
src/oobe/software/zip-downloader.ts:114:36 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'PathLike'.             Type 'undefined' is not assignable to type 'PathLike'.

114         res.pipe(createWriteStream(this.fullPath)); // Pipe to writer                                             ~~~~~~~~~~~~~
                                                                               src/routes/api.ts:100:22 - error TS2532: Object is possibly 'undefined'.

100             res.send(err.stack.toString());
                         ~~~~~~~~~

src/util/ahk.ts:83:122 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

83         const ahk_run = ahk.run_ahk_text(join(userspace_config.paths.software, userspace_config.software.ahk.paths.root, userspace_config.software.ahk.paths.dll), `#Include ${file}\n${func}()`);
                                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/util/copy-contents.ts:84:56 - error TS2339: Property 'contents' does not exist on type 'FileTreeNode'.
84         const nextDirs = await get_dirs_from_tree(node.contents) // Dirs in this current dir
                                                          ~~~~~~~~

src/util/copy-contents.ts:106:58 - error TS2339: Property 'contents' does not exist on type 'FileTreeNode'.

106         const nextFiles = await get_files_from_tree(node.contents) // Dirs in this current dir
                                                             ~~~~~~~~

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Try yarn install --production=false That should install the type definitions, which I think is causing the issues

@codemicro
Copy link
Contributor Author

c:\2keys\server>yarn install --production=false
yarn install v1.16.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | win32 | x64
gyp info spawn C:\Users\thoma\.windows-build-tools\python27\python.EXE
gyp info spawn args [ 'c:\\2keys\\server\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'c:\\2keys\\server\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'c:\\2keys\\server\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\thoma\\.node-gyp\\10.16.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\thoma\\.node-gyp\\10.16.0',
gyp info spawn args   '-Dnode_gyp_dir=c:\\2keys\\server\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\thoma\\.node-gyp\\10.16.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=c:\\2keys\\server',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'c:\\2keys\\server\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  main.cc
  run-ahk.cc
  current-dir.cc
  convert.cc
  win_delay_load_hook.cc
c:\2keys\server\src\cpp\convert.cc(34): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [c:\2keys\server\build\twokeys.vcxproj]
  c:\users\thoma\.node-gyp\10.16.0\include\node\v8.h(2891): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
c:\2keys\server\src\cpp\main.cc(68): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [c:\2keys\server\build\twokeys.vcxproj]
  c:\users\thoma\.node-gyp\10.16.0\include\node\v8.h(2891): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
c:\2keys\server\src\cpp\main.cc(73): warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [c:\2keys\server\build\twokeys.vcxproj]
  c:\users\thoma\.node-gyp\10.16.0\include\node\v8.h(2891): note: see declaration of 'v8::String::Utf8Value::Utf8Value'
     Creating library c:\2keys\server\build\Release\twokeys.lib and object c:\2keys\server\build\Release\twokeys.exp
  Generating code
  All 179 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  twokeys.vcxproj -> c:\2keys\server\build\Release\\twokeys.node
gyp info ok
Done in 16.79s.

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

yarn run tsc should now work

@codemicro
Copy link
Contributor Author

Still broken.

c:\2keys\server>yarn run tsc
yarn run v1.16.0
$ c:\2keys\server\node_modules\.bin\tsc
src/init/daemon.ts:110:27 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

110   const VBS_SCRIPT = join(process.env.APPDATA, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", `${WINDOWS_DAEMON_PREFIX}${name}.vbs`);
                              ~~~~~~~~~~~~~~~~~~~

src/init/get-config.ts:92:15 - error TS2339: Property 'push' does not exist on type 'Questions<Answers>'.
  Property 'push' does not exist on type 'Question<Answers>'.

92     questions.push({
                 ~~~~

src/init/get-config.ts:100:15 - error TS2339: Property 'push' does not exist on type 'Questions<Answers>'.
  Property 'push' does not exist on type 'Question<Answers>'.

100     questions.push({
                  ~~~~

src/init/get-config.ts:127:26 - error TS2339: Property 'push' does not exist on type 'ReadonlyArray<Question<Answers>>'.

127       questions_keyboard.push({
                             ~~~~

src/init/get-config.ts:133:26 - error TS2339: Property 'push' does not exist on type 'ReadonlyArray<Question<Answers>>'.

133       questions_keyboard.push({
                             ~~~~

src/init/get-config.ts:168:40 - error TS2538: Type 'undefined' cannot be used as an index type.

168         const name = answers_keyboards[keyboard_q.name]; // Get answer user provided for name
                                           ~~~~~~~~~~~~~~~

src/init/get-config.ts:175:50 - error TS2538: Type 'undefined' cannot be used as an index type.

175         current_keyboard_dir = answers_keyboards[keyboard.name];
                                                     ~~~~~~~~~~~~~

src/init/get-config.ts:177:26 - error TS2538: Type 'undefined' cannot be used as an index type.

177         config.keyboards[current_keyboard_name] = {
                             ~~~~~~~~~~~~~~~~~~~~~

src/oobe/index.ts:55:9 - error TS2454: Variable 'config' is used before being assigned.

55     if (config.oobe && !argv.force) {
           ~~~~~~

src/oobe/index.ts:64:7 - error TS2454: Variable 'config' is used before being assigned.

64       config.oobe = true;
         ~~~~~~

src/oobe/software/zip-downloader.ts:114:36 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'PathLike'.
  Type 'undefined' is not assignable to type 'PathLike'.

114         res.pipe(createWriteStream(this.fullPath)); // Pipe to writer
                                       ~~~~~~~~~~~~~

src/routes/api.ts:100:22 - error TS2532: Object is possibly 'undefined'.

100             res.send(err.stack.toString());
                         ~~~~~~~~~

src/util/ahk.ts:83:122 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

83         const ahk_run = ahk.run_ahk_text(join(userspace_config.paths.software, userspace_config.software.ahk.paths.root, userspace_config.software.ahk.paths.dll), `#Include ${file}\n${func}()`);
                                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/util/copy-contents.ts:84:56 - error TS2339: Property 'contents' does not exist on type 'FileTreeNode'.

84         const nextDirs = await get_dirs_from_tree(node.contents) // Dirs in this current dir
                                                          ~~~~~~~~

src/util/copy-contents.ts:106:58 - error TS2339: Property 'contents' does not exist on type 'FileTreeNode'.

106         const nextFiles = await get_files_from_tree(node.contents) // Dirs in this current dir
                                                             ~~~~~~~~

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Ok so I just ran the build commands on my end in my working code repo, and I got exactly what you are getting (which hasn't been touched since the last release)
Therefore, I'll now need to do some additional debugging, as the entire build process seems broken now.

Summary of issues to look into:

  1. Global install isn't working (Probable cause found, potential solution found)
  2. Source build isn't working

Probably will have to look into this later, but I'll push 2Keys to the top of my priority list.
Thank you for your help so far; hopefully, we can get this resolved!

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Right, so by the looks of things the issues with the global installer are that the source files aren't being packaged with the application, so I'll need to go and investigate that.

Just downloaded the tarball from npm, it appears this is true

Gum-Joe added a commit that referenced this issue Jun 25, 2019
Added src/cpp to tarball
@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

PR: #17

Gum-Joe added a commit that referenced this issue Jun 25, 2019
Source build now works, as TS file problems have been tidied!
Gum-Joe added a commit that referenced this issue Jun 25, 2019
Added src/cpp to tarball
@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

PR was merged, source build should now work, and global install should work
Need to publish to npm now.
Not publishing now, as I'll also have to publish the python detector, which may require modifications (however, it is still compatible with the current master branch) & I don't any time left today

@Gum-Joe Gum-Joe reopened this Jun 25, 2019
@codemicro
Copy link
Contributor Author

Looks like it worked - thanks!

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 26, 2019

You're welcome! I'll post back here once the global install has been published!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants