Open georgeedwards opened 7 years ago
@jianchun Any ideas? This is stopping me getting started with my project.
When you launch the command line, did you launch "Node.js (chakra) command prompt"? It is supposed to set an environment variable, then your command will run a custom version of node-gyp. E.g., my command window
echo %npm_config_node_gyp%
C:\Program Files\NodejsUwp\Console\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
Your log shows running a different node-gyp, which does not work with node-chakra:
"C:\\Program Files\\NodejsUwp\\Console\\node.exe" "C:\\Users\\George\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
@jianchun Here is my console:
and the full log:
Your environment has been set up for using Node.js 7.0.0-pre8 (x64) and npm.
C:\Users\George>node --version
v7.0.0-pre8
C:\Users\George>echo %npm_config_node_gyp%
%npm_config_node_gyp%
C:\Users\George>npm i uwp --target_arch=arm
> uwp@1.0.2 install C:\Users\George\node_modules\uwp
> node-gyp rebuild
C:\Users\George\node_modules\uwp>if not defined npm_config_node_gyp (node "C:\Users\George\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/v7.0.0-pre8/node-v7.0.0-pre8.tar.gz
gyp ERR! stack at Anonymous function (C:\Users\George\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\install.js:210:11)
gyp ERR! stack at emitOne (events.js:101:7)
gyp ERR! stack at emit (events.js:188:7)
gyp ERR! stack at Request.prototype.onRequestResponse (C:\Users\George\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:954:5)
gyp ERR! stack at emitOne (events.js:96:5)
gyp ERR! stack at emit (events.js:188:7)
gyp ERR! stack at parserOnIncomingClient (_http_client.js:472:3)
gyp ERR! stack at parserOnHeadersComplete (_http_common.js:105:5)
gyp ERR! stack at socketOnData (_http_client.js:361:3)
gyp ERR! stack at emitOne (events.js:96:5)
gyp ERR! stack at emit (events.js:188:7)
gyp ERR! stack at readableAddChunk (_stream_readable.js:177:11)
gyp ERR! stack at Readable.prototype.push (_stream_readable.js:135:3)
gyp ERR! stack at onread (net.js:542:5)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\NodejsUwp\\Console\\node.exe" "C:\\Users\\George\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\George\node_modules\uwp
gyp ERR! node -v v7.0.0-pre8
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\George\package.json'
npm WARN George No description
npm WARN George No repository field.
npm WARN George No README data
npm WARN George No license field.
npm WARN You are using a pre-release version of node and things may not work as expected
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\NodejsUwp\\Console\\node.exe" "C:\\Users\\George\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "uwp" "--target_arch=arm"
npm ERR! node v7.0.0-pre8
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! uwp@1.0.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uwp@1.0.2 install script 'node-gyp rebuild'.
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 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 information on how to open an issue for this project with:
npm ERR! npm bugs uwp
npm ERR! Or if that isn't available, 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:\Users\George\npm-debug.log
@georgeedwards I was on v6.0.0-... I uninstalled mine and installed v7.0.0-pre8 and that env variable is gone.
@munyirik Do you know if we removed that intentionally or there was a merge error? %npm_config_node_gyp%
is gone from "Node.js (chakra) command prompt".
@jianchun @munyirik So is there any plan to get this to work with the current releases?
I don't think npm_config_node_gyp has anything to do with it. I just tried to reproduce the problem and even though it's not set, I can build uwp.node ...
C:\Users\munyirik\Desktop\temp\temp>npm install uwp --target_arch=arm
> uwp@1.0.2 install C:\Users\munyirik\Desktop\temp\node_modules\uwp
> node-gyp rebuild
C:\Users\munyirik\Desktop\temp\node_modules\uwp>if not defined npm_config_node_gyp (node "C:\Program Files\NodejsUwp\Console\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
uwp.cc
win_delay_load_hook.cc
C:\Users\munyirik\Desktop\temp\node_modules\nan\nan.h(131): warning C4005: 'TYPE_CHECK': macro redefinition (compiling
source file ..\src\uwp.cc) [C:\Users\munyirik\Desktop\temp\node_modules\uwp\build\uwp.vcxproj]
C:\Program Files\NodejsUwp\Console\sdk\deps\chakrashim\include\v8.h(75): note: see previous definition of 'TYPE_CHECK
' (compiling source file ..\src\uwp.cc)
Creating library C:\Users\munyirik\Desktop\temp\node_modules\uwp\build\Release\uwp.lib and object C:\Users\munyiri
k\Desktop\temp\node_modules\uwp\build\Release\uwp.exp
Generating code
Finished generating code
uwp.vcxproj -> C:\Users\munyirik\Desktop\temp\node_modules\uwp\build\Release\\uwp.node
Can you try installing another package (e.g. serialport) and see if you have the problem?
The problem is he has a custom globally installed node-gyp, which takes precedence. The env variable would guarantee to use the correct node-gyp.
If I am right, workaround is either define that env variable, or uninstall the global node-gyp.
@munyirik I was talking about https://github.com/Microsoft/node-msft/blob/chnext-msi/tools/msvs/nodevars.bat#L10. Somehow the change got lost.
Yeah, the chakra IoT branch (https://github.com/munyirik/node/blob/chakra-uwp/tools/msvs/nodevars.bat) is missing this commit - https://github.com/Microsoft/node-msft/commit/7ea206bcadab737d3e1d3d919bfb7a61e8b96570
@kunalspathak Do you know if current node-ChakraCore nightly has the same problem? Install a global node-gyp and that'll take precedence?
BTW, @kunalspathak said node-gyp changes had been accepted. Maybe this won't be a problem with newer node-gyp release?
The change I made only touched gyp so nothing under the tools directory.
I'm planning to make another (node-chakra) release in a couple of weeks so I can include the change.
But on the other hand maybe node-chakracore should be used (with NodeRT). @georgeedwards you have the option to use node-chakracore instead. Then you can use NodeRT to access UWP APIs.
The change I made only touched gyp so nothing under the tools directory.
Change in tools directory meant to always use local node-gyp. If newer node-gyp works (e.g. user acquires latest node-gyp and installs globally), then we don't need tools directory change.
I am trying to follow the
Hello Blinky
tutorial sample, but have fallen at the first hurdle trying to install this. I have downloaded the node Chakra, opened that command line and then runnpm install uwp --target_arch=arm
(NB: I get the same result without the flagged argument).This is what I get:
Looking at the nodejs dists, it seems as though there is in fact no v7.0.0-pre8 release, only v7.0.0, v7.1.0, v7.2.0, v7.2.1 ... v7.5.0.
Can we fix this please?