Closed hgwood closed 8 years ago
The workaround turned out to fail: node-gyp just deletes the folder and attempts to download anyway.
I've tried this also:
npm i uwp --ignore-scripts
cd node_modules/uwp
node-gyp rebuild --target=5.0.0
Got some compile errors:
..\src\uwp.cc(74): error C2065: 'JsErrorCode': undeclared identifier [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(74): error C2146: syntax error: missing ';' before identifier 'err' [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(74): error C2065: 'err': undeclared identifier [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(75): error C2061: syntax error: identifier 'JsProjectionCallback' [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(77): error C3481: 'jsCallback': lambda capture variable not found [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(77): error C3481: 'jsContext': lambda capture variable not found [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(77): error C3493: 'jsCallback' cannot be implicitly captured because no default capture mode has been specified [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(77): error C3493: 'jsContext' cannot be implicitly captured because no default capture mode has been specified [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(74): error C3861: 'JsSetProjectionEnqueueCallback': identifier not found [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(82): error C2065: 'err': undeclared identifier [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(82): error C2065: 'JsNoError': undeclared identifier [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(104): error C3861: 'JsProjectWinRTNamespace': identifier not found [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
..\src\uwp.cc(104): error C2065: 'JsNoError': undeclared identifier [C:\Dropbox\Coding\bb8\node_modules\uwp\build\uwp.vcxproj]
Tried copying over files from C:\Program Files (x86)\NodejsUwp\Console\sdk
to ~/.node-gyp/5.0.0
, and the errors were still the same.
Also tried copying uwp.node
and DLLs from C:\Program Files (x86)\NodejsUwp\x86
to node_modules/uwp/build/release
but then require('uwp')
throws Module did not self-register
.
@hgwood Apologize for late response. Were you running "npm" and "node-gyp" that come with "Node.js Tools for Windows IoT 1.3"? You can try launch "Node.js (chakra) command prompt" and run "npm i uwp --verbose". The install comes with a customized "node-gyp" that should not download.
npm
and node-gyp
were run using Chakra Node yes. I tried running npm i uwp --verbose
from the "Node.js (chakra) command prompt" and ran into the same problem (node-gyp tries to download the headers). Here's stdout from npm:
> uwp@1.0.1 install c:\Dropbox\Coding\bb8-2\node_modules\uwp
> node-gyp rebuild
c:\Dropbox\Coding\bb8-2\node_modules\uwp>if not defined npm_config_node_gyp (node "C:\Users\Hugo Wood\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
It can be seen clearly that it is using the normal node-gyp install and not a custom one. Moreover, I cannot find any node-gyp in C:\Program Files (x86)\NodejsUwp
nor in .\node_modules\uwp
(after an npm i --ignore-scripts
).
Thanks for your help.
It seems globally installed node-gyp by the user has higher priority... The customized node-gyp can be found at "c:\Program Files (x86)\NodejsUwp\Console\node_modules\npm\bin\node-gyp-bin". Try add that to front of PATH, or uninstall global node-gyp (npm uninstall -g node-gyp).
I spent some more time trying this and found that as long as you have your own npm installed globally, your own npm will always be picked and it will not use our node-gyp. I'm making some tweaks to "Node.js (chakra) command prompt" to work around this problem. In the interim, please try to uninstall the global npm/node-gyp (in your AppData: C:\Users\Hugo Wood\AppData\Roaming\npm
).
I'm sorry I don't understand what npm
you want me to use instead of the one in %APPDATA%
.
Oh, I guess you meant npm
from c:\Program Files (x86)\NodejsUwp\Console\node_modules\npm
, but I don't have the folder c:\Program Files (x86)\NodejsUwp\Console\node_modules
. Maybe I should try to reinstall Node.js Chakra.
Reinstalled. Still no c:\Program Files (x86)\NodejsUwp\Console\node_modules
.
@hgwood That's strange. What do you have under C:\Program Files (x86)\NodejsUwp\Console
? I have
Directory of C:\Program Files (x86)\NodejsUwp\Console
01/08/2016 09:44 AM <DIR> .
01/08/2016 09:44 AM <DIR> ..
11/30/2015 01:56 PM 3,412 CopyNodeChakra.ps1
11/30/2015 01:36 PM 3,813,520 node.exe
11/30/2015 01:29 PM 700 nodevars.bat
11/30/2015 01:28 PM 6,646 node_etw_provider.man
01/08/2016 09:43 AM <DIR> node_modules
11/30/2015 01:28 PM 4,974 node_perfctr_provider.man
11/30/2015 01:28 PM 623 npm
11/30/2015 01:28 PM 483 npm.cmd
01/08/2016 09:43 AM <DIR> sdk
For the npm/node-gyp issue, we'll have a better solution in next release. For now the easiest workaround is to uninstall the global npm/node-gyp:
npm uninstall -g node-gyp
npm uninstall -g npm
Then launch Node.js (chakra) command prompt
and try npm i uwp
.
Here's the content of C:\Program Files (x86)\NodejsUwp\Console
:
Répertoire de c:\Program Files (x86)\NodejsUwp\Console
08/01/2016 18:01 <DIR> .
08/01/2016 18:01 <DIR> ..
30/11/2015 13:56 3 412 CopyNodeChakra.ps1
30/11/2015 13:36 3 813 520 node.exe
30/11/2015 13:29 700 nodevars.bat
30/11/2015 13:28 6 646 node_etw_provider.man
30/11/2015 13:28 4 974 node_perfctr_provider.man
08/01/2016 18:00 <DIR> sdk
No npm. I'd be willing to uninstall my global npm, but I'd be left without any npm at all to run npm i uwp
:). I've uninstalled my global node-gyp by the way. Now when I npm i uwp
, it uses C:\Users\Hugo Wood\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js
instead and I end up with the same errors.
Any idea on why I'm missing parts of NodejsUwp
?
Thanks for your continued help.
@hgwood Haven't seen that before... When you install Node.js Tools for Windows IoT 1.3 and it pops up installing Node.js (chakra), make sure you have all features selected? Maybe you accidentally unselected npm?
Ahah, yes that was it. I probably unchecked it willingly, thinking I didn't need another npm, and then forgot about it. Sorry about that. Thanks a lot for your help. Now the compilation goes through and I get some compile errors, but that's another issue ;).
I spent some more time trying this and found that as long as you have your own npm installed globally, your own npm will always be picked and it will not use our node-gyp. I'm making some tweaks to "Node.js (chakra) command prompt" to work around this problem.
I notice it has been fixed in Node.js Tools for Windows IoT 1.5. Nice work!
I notice it has been fixed in Node.js Tools for Windows IoT 1.5. Nice work!
Thanks for confirming!
The latest Node.js Tools for Windows IoT (1.5.1) unfortunately does not fix it for me, I'm getting the same error mentioned by @hgwood here.
@grownseed Check that node
, npm
and node-gyp
all points to the ones that come with the Node.js Chakra installation (C:\Program Files (x86)\NodejsUwp\Console
). Also have a look here, along with the following answers.
Thanks @hgwood but still no luck... I've removed anything Node-related on my system, installed Node.js with Chakra, re-installed Visual Studio Community 2015 with Visual C++, Visual Studio Extensibility Tools Update 1, Windows 10 SDK, Universal Windows App Development Tools, rebooted, added GYP_MSVS_VERSION 2015
to my environment variables, npm config set python c:\python2.7\python.exe
.
where node
:
C:\Program Files\NodejsUwp\Console\node.exe
where npm
:
C:\Program Files\NodejsUwp\Console\npm
C:\Program Files\NodejsUwp\Console\npm.cmd
where node-gyp
:
C:\Program Files\NodejsUwp\Console\node_modules\npm\bin\node-gyp-bin\node-gyp
C:\Program Files\NodejsUwp\Console\node_modules\npm\bin\node-gyp-bin\node-gyp.cmd
Attempting to npm install uwp
:
[...]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\prsht.h(607): error C2146: s
yntax error : missing ';' before identifier 'hdr' [C:\Users\Hadrien\Documents\D
ev\bb\node_modules\uwp\build\uwp.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\prsht.h(607): error C4430: m
issing type specifier - int assumed. Note: C++ does not support default-int [C:
\Users\Hadrien\Documents\Dev\bb\node_modules\uwp\build\uwp.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\windows.h(247): warning C419
3: #pragma warning(pop) : no matching '#pragma warning(push)' [C:\Users\Hadrien
\Documents\Dev\bb\node_modules\uwp\build\uwp.vcxproj]
C:\Program Files\NodejsUwp\Console\sdk\deps\chakrashim\include\v8.h(65): fatal
error C1189: #error : Wrong Windows SDK version [C:\Users\Hadrien\Documents\De
v\bb\node_modules\uwp\build\uwp.vcxproj]
[...]
Of particular note is Wrong Windows SDK version
, it looks like it's pointing to the Windows 8.1 Kit, even though I do have the Windows 10 Kit available. I'm now stuck trying to figure out how to tell node-gyp
to use the correct kit (if that's actually what's going on here...).
The
node.exe
that comes with the Node.js Tools for Windows IoT 1.3 advertises5.0.0-0
as a version (node --version
). When Inpm install uwp
,node-gyp
tries to download the sources for this version of node fromhttps://nodejs.org/dist/v5.0.0-0/node-v5.0.0-0.tar.gz
and logically fails, because this version it not an official version of Node.I'm not sure how I should proceed. I guess I could, as a workaround, copy the sources from Node v5 to
~/.node-gyp/5.0.0-0
. I'll try that and let you know.