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

fatal error C1107 with VS 2017 #65

Open
muten84 opened this issue May 17, 2017 · 19 comments
Open

fatal error C1107 with VS 2017 #65

muten84 opened this issue May 17, 2017 · 19 comments

Comments

@muten84
Copy link

muten84 commented May 17, 2017

Hi, i'm using electron and nodejs native modules to develop an app that use gps. The idea was to read NMEA sentences from serial port. In my Windows 10 envirnoment i can rebuild the serialport native module and using it with electron (using electron-rebuild) and all works well.

Then (a couple of days ago) i see the NodeRT project and i realized that i can use UWP API to use geolocation from electron, i followed the guide but i can't recompile the module for electron (neither simply for node), i got the error shown below and i can't recognize why it happens.
I'm new to Microsoft technologies, i tried a lot of things and nothing works. Can anyone explain me what i have to do?
I'm using Windows 10
I've installed Visual Studio 2017 with all SDKs,
i installed latest Windows10 SDK,
node version 7.10.0
npm version 4.2.0
node-gyp 3.6.1
nodert 2.0.5

..\_nodert_generated.cpp : fatal error C1107: impossibile trovare l'assembly 'platform.winmd': specificare il percorso
di ricerca dell'assembly utilizzando /AI o impostando la variabile d'ambiente LIBPATH [C:\Users\biful\tools\nodert-2.0.
5\output\windows.devices.geolocation\build\binding.vcxproj]
..\NodeRtUtils.cpp : fatal error C1107: impossibile trovare l'assembly 'platform.winmd': specificare il percorso di ric
erca dell'assembly utilizzando /AI o impostando la variabile d'ambiente LIBPATH [C:\Users\biful\tools\nodert-2.0.5\outp
ut\windows.devices.geolocation\build\binding.vcxproj]

The messages are localized for italian language in english should be "could not find assembly..."
This issue was opened and closed also in #56 but in my case after installing latest windows 10 sdk nothing changes.

Any helps is appreciated.

Luigi

@nadavbar
Copy link
Member

Hi,
NodeRT only supports VS2015 at the moment, while support for VS 2017 support is in the works, the easiest thing to do for now will be to probably install VS2015 together with a compatible SDK. Sorry for the inconvenience.

@muten84
Copy link
Author

muten84 commented May 17, 2017

Hi and thanks for the answer. If i can ask you a little suggest about how to save time.
Do you think that VS2015 and VS2017 can live together on the same machine to get NodeRT compilation working well?

@nadavbar
Copy link
Member

nadavbar commented May 17, 2017

Yes, as far as I know there should be no problem with having VS 2015 and VS 2017 side by side.

@muten84
Copy link
Author

muten84 commented May 17, 2017

Ok i Will try . should i close the issue? i prefer to check it before, if u agree. Thanks for all.

@nadavbar
Copy link
Member

Sure, the issue on my side is to have support for VS 2017, so you can leave it open.

@muten84 muten84 changed the title fatal error C1107 fatal error C1107 with VS 2017 May 20, 2017
@muten84
Copy link
Author

muten84 commented May 20, 2017

Hi i installed VS 2015 and now the node-gyp return an error TRK0005 and fail to locate CL.exe. I'm sure there is something missing in my installation, on Microsoft tech doc i can read that by default Visual C++ compiler is not installed, so i have to check it during installation. Unfortunately nothing changes after Visual C++ installation, and i still get the TRK0005 error.

In other forums and on Stackoverflow other users using node-gyp solved installing the MS build tools 2015. I did the same but nodert module still not find CL.exe.

Anyone knows where the nodert module expects to find CL.exe? i'm a little discouraged about this situation.

@nadavbar
Copy link
Member

cl.exe should be located at this path:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

If it's missing from there then you might need to re-install VS2015.
If it's there - try adding this directory path to your PATH enviornment variable. (and don't forget to open a new cmd window for the changes to take effect..)

@muten84
Copy link
Author

muten84 commented May 20, 2017

CL.exe isn't there this is a good thing because i found the problem. The bad thing is that reinstalling from Visual Studio 2015 the installer don't put the compiler in that folder. Infact if i check Visual C++ Common Tools after the installation finished nothing changes (reopened cmd window, rebooted the system,). So i reopened the VS 2015 installer and the Visual C++ Common tools component is unchecked.

I think the installation of this component fails, i'm trying uninstalling all Visual C++ component installed during the installation of VS2017.

Stay tuned :-)

Luigi

@muten84
Copy link
Author

muten84 commented May 20, 2017

I uninstalled all and reinstalled all and now from NodeRTUI i got the nice popup "Yay! ...". Tested from command line with npm install too, i got not errors with message "Finished generating code".

Next step is using with Electron. Thx for your patience and support!

@nadavbar
Copy link
Member

Happy to hear that. BTW, if you are not dependent on a specific windows SDK version, you can just pick up the modules from NPM instead of generating: https://www.npmjs.com/~nodert-win10

@muten84
Copy link
Author

muten84 commented May 21, 2017

As i understood with electron i need to rebuild them with electron-rebuild. Maybe the SDK uses a runtime that electron has just bound with it? If so nice to hear that. However rebuilding from source was a good experience :)

UPDATE: i didn't read well, you mean using the generated source directly from npm instead of generating from NodeRTUI... nevermind compilation, sorry :D :D :D

@d-rep
Copy link

d-rep commented May 24, 2017

I'm getting similar failure message withfatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable. I have both Visual Studio Community 2015 and 2017 installed.

$ npm install @nodert-win10/windows.media.ocr

> @nodert-win10/windows.media.ocr@0.2.96 install C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr
> node-gyp rebuild --msvs_version=2015


C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr>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 --msvs_version=2015 )  else (node "" rebuild --msvs_version=2015 )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  _nodert_generated.cpp
..\_nodert_generated.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable [C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr\build\binding.vcxproj]
  NodeRtUtils.cpp
..\NodeRtUtils.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable [C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr\build\binding.vcxproj]
  OpaqueWrapper.cpp
..\OpaqueWrapper.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable [C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr\build\binding.vcxproj]
  CollectionsConverterUtils.cpp
..\CollectionsConverterUtils.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable [C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr\build\binding.vcxproj]
  win_delay_load_hook.cc
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.cc : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable [C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr\build\binding.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
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" "--msvs_version=2015"
gyp ERR! cwd C:\Users\drew\node-microsoft-ocr\node_modules\@nodert-win10\windows.media.ocr
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
npm WARN node-microsoft-ocr@1.0.0 No description
npm WARN node-microsoft-ocr@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@nodert-win10/windows.media.ocr"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! @nodert-win10/windows.media.ocr@0.2.96 install: `node-gyp rebuild --msvs_version=2015`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nodert-win10/windows.media.ocr@0.2.96 install script 'node-gyp rebuild --msvs_version=2015'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @nodert-win10/windows.media.ocr package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild --msvs_version=2015
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @nodert-win10/windows.media.ocr
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @nodert-win10/windows.media.ocr
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\drew\AppData\Roaming\npm-cache\_logs\2017-05-24T21_08_33_397Z-debug.log

I tried running set LIBPATH="C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.15063.0" (which has a file named Windows.winmd) prior to the npm install but got the same error.

Any other ideas for things I can try?

@nadavbar
Copy link
Member

The version of the npm modules search for the winmd files under

C:\Program Files (x86)\Windows Kits\10\UnionMetadata

Can you verify that you have a windows.winmd file under that folder? (it's one lever higher than the one that you've mentioned)

@d-rep
Copy link

d-rep commented May 25, 2017

That directory did not contain the file, so I moved the file C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.15063.0\Windows.winmd up one directory (to match what you have) and the npm install worked! Thanks @nadavbar

@d-rep
Copy link

d-rep commented May 25, 2017

...when attempting to use @nodert-win10/windows.media.ocr, I found it needs windows.graphics.imaging to convert image files to bitmap. Is there a reason that should require VS 2013 while the OCR package requires 2015?

$ npm i windows.graphics.imaging

> windows.graphics.imaging@0.1.6 install C:\Users\drew\node-microsoft-ocr\node_modules\windows.graphics.imaging
> node-gyp rebuild --msvs_version=2013


C:\Users\drew\node-microsoft-ocr\node_modules\windows.graphics.imaging>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 --msvs_version=2013 )  else (node "" rebuild --msvs_version=2013 )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
cl : Command line error D8016: '/MT' and '/ZW' command-line options are incompatible [C:\Users\drew\node-microsoft-ocr\node_modules\windows.graphics.imaging\build\binding.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
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" "--msvs_version=2013"
gyp ERR! cwd C:\Users\drew\node-microsoft-ocr\node_modules\windows.graphics.imaging
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
npm WARN node-microsoft-ocr@1.0.0 No description
npm WARN node-microsoft-ocr@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "windows.graphics.imaging"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! windows.graphics.imaging@0.1.6 install: `node-gyp rebuild --msvs_version=2013`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows.graphics.imaging@0.1.6 install script 'node-gyp rebuild --msvs_version=2013'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows.graphics.imaging package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild --msvs_version=2013
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows.graphics.imaging
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows.graphics.imaging
npm ERR! There is likely additional logging output above.

@nadavbar
Copy link
Member

The modules without the "@nodert-win10" scope are older versions compatible with VS 2013 and Win 8.1. Sorry for the confusion, but instead you can run

npm install @nodert-win10/windows.graphics.imaging

And it should solve the issue (note the addition of the @nodert-win10 scope to the module)

@Shoshin23
Copy link

Hi,
I'm trying to use NodeRT in order to use windows.media.ocr. I'm running into the problem. Should I install VS 2017 or is there a workaround that is available for me to use without having to install VS 2015. I'm asking simply because I need to take out all of VS 2017 before installing it because of disk space issues.

Thanks!

@mccxiv
Copy link

mccxiv commented Jul 15, 2018

As mentioned by @d-rep and this answer

One needs to copy Windows.winmd

from: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0
to C:\Program Files (x86)\Windows Kits\10\UnionMetadata\

I honestly don't even understand what this project does. I'm just trying to get a dependency to install correctly. Could we get a proper fix for this?

@nadavbar
Copy link
Member

@mccxiv please note that this is an open source project, currently maintained voluntarily by the community. If you look for solutions that provide "proper fixes" I'm sure that you can find other alternatives (like writing a native addon).

I believe that a recent pull request which I accepted (#102) should have solved this issue.
You might want to update the dependencies of the modules that you are using to the ones under @nodert-win10-rs4 namespace in npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants