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

Node sources for version 5.0.0-0 do not exist. #11

Closed
hgwood opened this issue Dec 30, 2015 · 19 comments
Closed

Node sources for version 5.0.0-0 do not exist. #11

hgwood opened this issue Dec 30, 2015 · 19 comments

Comments

@hgwood
Copy link

hgwood commented Dec 30, 2015

The node.exe that comes with the Node.js Tools for Windows IoT 1.3 advertises 5.0.0-0 as a version (node --version). When I npm install uwp, node-gyp tries to download the sources for this version of node from https://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.

$ npm i uwp
npm WARN engine xpc-connection@0.1.4: wanted: {"node":">=0.8"} (current: {"node":"5.0.0-0","npm":"3.2.1"})
npm WARN install Couldn't install optional dependency: Unsupported

> uwp@1.0.1 install C:\Dropbox\Coding\bb8\node_modules\uwp
> node-gyp rebuild


C:\Dropbox\Coding\bb8\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 )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v5.0.0-0/node-v5.0.0-0.tar.gz
gyp ERR! stack    at Anonymous function (C:\Users\Hugo Wood\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\install.js:251:11)
gyp ERR! stack    at emitOne (events.js:82:7)
gyp ERR! stack    at emit (events.js:169:7)
gyp ERR! stack    at Request.prototype.onRequestResponse (C:\Users\Hugo Wood\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:992:5)
gyp ERR! stack    at emitOne (events.js:77:5)
gyp ERR! stack    at emit (events.js:169:7)
gyp ERR! stack    at parserOnIncomingClient (_http_client.js:421:3)
gyp ERR! stack    at parserOnHeadersComplete (_http_common.js:88:5)
gyp ERR! stack    at socketOnData (_http_client.js:311:3)
gyp ERR! stack    at emitOne (events.js:77:5)
gyp ERR! stack    at emit (events.js:169:7)
gyp ERR! stack    at readableAddChunk (_stream_readable.js:146:9)
gyp ERR! stack    at Readable.prototype.push (_stream_readable.js:110:3)
gyp ERR! stack    at onread (net.js:523:5)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files (x86)\\NodejsUwp\\Console\\node.exe" "C:\\Users\\Hugo Wood\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dropbox\Coding\bb8\node_modules\uwp
gyp ERR! node -v v5.0.0-0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm WARN EPACKAGEJSON bb8@1.0.0 No description
npm WARN EPACKAGEJSON bb8@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files (x86)\\NodejsUwp\\Console\\node.exe" "C:\\Users\\Hugo Wood\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "uwp"
npm ERR! node v5.0.0-0
npm ERR! npm  v3.2.1
npm ERR! code ELIFECYCLE

npm ERR! uwp@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uwp@1.0.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the uwp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls uwp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Dropbox\Coding\bb8\npm-debug.log

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.

@hgwood
Copy link
Author

hgwood commented Dec 30, 2015

The workaround turned out to fail: node-gyp just deletes the folder and attempts to download anyway.

@hgwood
Copy link
Author

hgwood commented Dec 31, 2015

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.

@hgwood
Copy link
Author

hgwood commented Dec 31, 2015

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.

@jianchun
Copy link

jianchun commented Jan 4, 2016

@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.

@hgwood
Copy link
Author

hgwood commented Jan 5, 2016

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.

@jianchun
Copy link

jianchun commented Jan 5, 2016

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).

@jianchun
Copy link

jianchun commented Jan 5, 2016

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).

@hgwood
Copy link
Author

hgwood commented Jan 8, 2016

I'm sorry I don't understand what npm you want me to use instead of the one in %APPDATA%.

@hgwood
Copy link
Author

hgwood commented Jan 8, 2016

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.

@hgwood
Copy link
Author

hgwood commented Jan 8, 2016

Reinstalled. Still no c:\Program Files (x86)\NodejsUwp\Console\node_modules.

@jianchun
Copy link

jianchun commented Jan 8, 2016

@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.

@hgwood
Copy link
Author

hgwood commented Jan 9, 2016

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.

@jianchun
Copy link

@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?

@hgwood
Copy link
Author

hgwood commented Jan 10, 2016

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 ;).

@hgwood hgwood closed this as completed Jan 10, 2016
@hgwood
Copy link
Author

hgwood commented Jan 28, 2016

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!

@jianchun
Copy link

I notice it has been fixed in Node.js Tools for Windows IoT 1.5. Nice work!

Thanks for confirming!

@grownseed
Copy link

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.

@hgwood
Copy link
Author

hgwood commented Feb 27, 2016

@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.

@grownseed
Copy link

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...).

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

3 participants