Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I am currently working on a Win7-64 (Ultimate) machine with the
The most obvious odd thing I see is the line:
LINK : fatal error LNK1181: cannot open input file 'C:\Users\wittend.node-gyp\0.10.1\node.lib'
By default, there is no copy of node.lib in
But Windows, when faced with a path with two consecutive backslashes, sometimes reads them as a single backslash. So windows looks for node.lib in C:\Users\wittend.node-gyp\0.10.1\node.lib. This happened for me with node-gyp 1.10.0, so I moved a copy of node.lib from the \Release folder up a level in that tree. But the problem came back when node-gyp got updated. I am not at all certain that is the correct version of the library to use. And if there is an unset environment variable, what is it?
A full typical example of the output I get is this:
Can you please temporarily insert some debug statements into 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js' on this line (exact line number may be different) and re-run?:
console.log('buildType: ' + buildType); console.log('nodeDir: ' + nodeDir); console.log('arch: ' + arch); console.log('buildDir: ' + buildDir); console.log('archNodeLibPath: ' + archNodeLibPath); console.log('buildNodeLibPath: ' + buildNodeLibPath);
Thanks for the response.
The full output with those lines inserted follows (attempting to install the ftdi module as global)>
== Console Output =================================
C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modu
npm ERR! System Windows_NT 6.1.7601
== END of output =================================
0 info it worked if it ends with ok
\n eeeee eeeee eeeee eeee e eeeee \n 8 8 8 88 8 8 8 8 8 " \n 8e 8 8 8 8e 8 8eee 8e 8eeee \n 88 8 8 8 88 8 88 e 88 88 \n 88 8 8eee8 88ee8 88ee 88 8ee88 8ee88\n\n eeee eeeee eeeee e \n 8 8 8 8 8 \n 8eee 8e 8e 8 8e \n 88 88 88 8 88 \n 88 88 88ee8 88 \n\n\n# Installing\n\n## Prerequisites:\n\nInstall the driver: ftdi\n\nIf you're are using a Linux distribution or Mac OS X you can run the install.sh script file...\n\n\n npm install ftdi\n\nThis assumes you have everything on your system necessary to compile ANY native module for Node.js. This may not be the case, though, so please ensure the following are true for your system before filing an issue about "Does not install". For all operatings systems, please ensure you have Python 2.x installed AND not 3.0, node-gyp (what we use to compile) requires Python 2.x.\n\n### Windows:\n\nEnsure you have Visual Studio 2010 installed. If you have any version OTHER THAN VS 2010, please read this: #44 \n\n### Mac OS X:\n\nEnsure that you have at a minimum the xCode Command Line Tools installed appropriate for your system configuration. If you recently upgrade OS, it probably removed your installation of Command Line Tools, please verify before submitting a ticket.\n\n### Linux:\n\nYou know what you need for you system, basically your appropriate analog of build-essential. Keep rocking!\n\n\n# Usage\n\n## Listing or finding devices\n\n
39 silly resolved readmeFilename: 'README.md',
39 silly resolved _id: 'firstname.lastname@example.org',
39 silly resolved _from: 'ftdi@' } ]
40 info install email@example.com into C:\Users\wittend\AppData\Roaming\npm
41 info installOne firstname.lastname@example.org
42 verbose from cache C:\Users\wittend\AppData\Roaming\npm-cache\ftdi\1.0.0\package\package.json
43 info C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi unbuild
44 verbose read json C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi\package.json
45 verbose tar unpack C:\Users\wittend\AppData\Roaming\npm-cache\ftdi\1.0.0\package.tgz
46 silly lockFile b2fd57a8-ta-Roaming-npm-node-modules-ftdi C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi
47 verbose lock C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi C:\Users\wittend\AppData\Roaming\npm-cache\b2fd57a8-ta-Roaming-npm-node-modules-ftdi.lock
48 silly lockFile 35a8219b-npm-cache-ftdi-1-0-0-package-tgz C:\Users\wittend\AppData\Roaming\npm-cache\ftdi\1.0.0\package.tgz
49 verbose lock C:\Users\wittend\AppData\Roaming\npm-cache\ftdi\1.0.0\package.tgz C:\Users\wittend\AppData\Roaming\npm-cache\35a8219b-npm-cache-ftdi-1-0-0-package-tgz.lock
50 silly gunzTarPerm modes [ '755', '644' ]
51 silly gunzTarPerm extractEntry package.json
52 silly gunzTarPerm modified mode [ 'package.json', 438, 420 ]
53 silly gunzTarPerm extractEntry .npmignore
54 silly gunzTarPerm modified mode [ '.npmignore', 438, 420 ]
55 silly gunzTarPerm extractEntry README.md
56 silly gunzTarPerm modified mode [ 'README.md', 438, 420 ]
57 silly gunzTarPerm extractEntry index.js
58 silly gunzTarPerm modified mode [ 'index.js', 438, 420 ]
59 silly gunzTarPerm extractEntry binding.gyp
60 silly gunzTarPerm modified mode [ 'binding.gyp', 438, 420 ]
61 silly gunzTarPerm extractEntry install.sh
62 silly gunzTarPerm modified mode [ 'install.sh', 438, 420 ]
63 silly gunzTarPerm extractEntry lib/amd64/ftd2xx.lib
64 silly gunzTarPerm modified mode [ 'lib/amd64/ftd2xx.lib', 438, 420 ]
65 silly gunzTarPerm extractEntry lib/ftd2xx.h
66 silly gunzTarPerm modified mode [ 'lib/ftd2xx.h', 438, 420 ]
67 silly gunzTarPerm extractEntry lib/i386/ftd2xx.lib
68 silly gunzTarPerm modified mode [ 'lib/i386/ftd2xx.lib', 438, 420 ]
69 silly gunzTarPerm extractEntry license
70 silly gunzTarPerm modified mode [ 'license', 438, 420 ]
71 silly gunzTarPerm extractEntry src/ftdi_constants.h
72 silly gunzTarPerm modified mode [ 'src/ftdi_constants.h', 438, 420 ]
73 silly gunzTarPerm extractEntry src/ftdi_device.cc
74 silly gunzTarPerm modified mode [ 'src/ftdi_device.cc', 438, 420 ]
75 silly gunzTarPerm extractEntry src/ftdi_device.h
76 silly gunzTarPerm modified mode [ 'src/ftdi_device.h', 438, 420 ]
77 silly gunzTarPerm extractEntry src/ftdi_driver.cc
78 silly gunzTarPerm modified mode [ 'src/ftdi_driver.cc', 438, 420 ]
79 silly gunzTarPerm extractEntry src/ftdi_driver.h
80 silly gunzTarPerm modified mode [ 'src/ftdi_driver.h', 438, 420 ]
81 verbose read json C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi\package.json
82 silly lockFile b2fd57a8-ta-Roaming-npm-node-modules-ftdi C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi
83 silly lockFile b2fd57a8-ta-Roaming-npm-node-modules-ftdi C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi
84 silly lockFile 35a8219b-npm-cache-ftdi-1-0-0-package-tgz C:\Users\wittend\AppData\Roaming\npm-cache\ftdi\1.0.0\package.tgz
85 silly lockFile 35a8219b-npm-cache-ftdi-1-0-0-package-tgz C:\Users\wittend\AppData\Roaming\npm-cache\ftdi\1.0.0\package.tgz
86 info preinstall email@example.com
87 verbose unsafe-perm in lifecycle true
88 silly exec cmd "/c" "node-gyp rebuild"
89 silly cmd,/c,node-gyp rebuild,C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi spawning
90 info firstname.lastname@example.org Failed to exec preinstall script
91 info C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi unbuild
92 verbose from cache C:\Users\wittend\AppData\Roaming\npm\node_modules\ftdi\package.json
93 info preuninstall email@example.com
94 info uninstall firstname.lastname@example.org
95 verbose true,C:\Users\wittend\AppData\Roaming\npm\node_modules,C:\Users\wittend\AppData\Roaming\npm\node_modules unbuild email@example.com
96 info postuninstall firstname.lastname@example.org
97 error email@example.com preinstall:
98 error Failed at the firstname.lastname@example.org preinstall script.
98 error This is most likely a problem with the ftdi package,
98 error not with npm itself.
98 error Tell the author that this fails on your system:
98 error node-gyp rebuild
98 error You can get their info via:
98 error npm owner ls ftdi
98 error There is likely additional logging output above.
99 error System Windows_NT 6.1.7601
100 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "-g" "install" "ftdi"
101 error cwd D:\Projects\code\web-csg
102 error node -v v0.10.2
103 error npm -v 1.2.15
104 error code ELIFECYCLE
105 verbose exit [ 1, true ]
== END of output =================================
npm ERR! System Windows_NT 6.1.7601
at the console...
On Sun, Mar 31, 2013 at 9:28 AM, Brian White email@example.com:
I'm not quite sure what it is you are looking at. Nothing has changed
LINK : fatal error LNK1181: cannot open input file
seems the same. It appears that 'Arch' should be getting substituted into
On Sun, Mar 31, 2013 at 9:49 AM, Brian White firstname.lastname@example.org:
Thanks for looking at it for me. I looked myself some more, and I'm back
I may just have to make my own de novo. So much for code re usability.
On Sun, Mar 31, 2013 at 11:46 PM, Brian White email@example.com:
Perhaps you're right. Either way, I'm frustrated with this, and it has
On Thu, Apr 4, 2013 at 12:34 AM, Brian White firstname.lastname@example.org:
I am seeing this too as well. It looks like some environmental variable needs to be set; in fact something is even mentioned in the error, but it doesn't give the variable. If there was some environmental variable and it was set to the architecture, then it would probably insert the proper string between the two backslashes and it would be fine.
I have moved on in order to complete my current project. I will attempt to
On Sun, Apr 7, 2013 at 2:07 PM, Brian White email@example.com:
Packages requiring node-gyp remain the roadblock to me using nodejs for anything on Windows.
I thought that I would revisit this problem to see if anything has improved.
I am using Win 7 Ultimate 32 bit with SP1 on an older HP Centrino Duo laptop. Nothing special, nothing weird.
I removed everything that seemed in any way related to this problem. Visual studio 10, Windows SDK, related service packs, node-gyp and finally node itself. Then I set about re-installing everything on this machine exactly by-the-book. I installed Node 10.5 and node-gyp 9.5 using 'npm -g install xxx'. I installed Visual Studio C++ 2010 and the Windows SDK from the links on the node-gyp page in the NPM registry. I instaled the VC++ SP1 as well, as mentioned for 64 bit builds, because the SDK install failed without it (though I am doing 32 bit builds).
As in all previous attempts, efforts to install any packages dependent on node-gyp failed. The reported errors vary slightly, but always point to node-gyp and usually take a form such as:
I really don't know what the problem is, but it has totally put me off using node.js. If a package as pervasive and necessary as node-gyp cannot be counted on to work, the entire node ecosystem must be considered too fragile for useful work.
@wittend Your particular error it looks like is a problem on Microsoft's end: http://connect.microsoft.com/VisualStudio/feedback/details/660584/ (p.s. google is your friend...)
Yes, I had spent a lot of time with google before I posted this. My
On Wed, May 8, 2013 at 2:48 PM, Nathan Rajlich firstname.lastname@example.org:
Well the thing is, myself and many others have gotten the proper
On Sun, May 12, 2013 at 4:56 PM, Dave email@example.com wrote:
Is there no option to use another compiler? Microsoft explicitly states
On Sun, May 12, 2013 at 7:04 PM, Nathan Rajlich firstname.lastname@example.org:
Hi guys, I got this sorted out and hope that it will work for you too.
Had the exact same problem, Win7 / 64 / Ultimate and was missing the ammintrin.h file
Much work has gone into fixing node-gyp on Windows recently. Now we're down to awaiting a final integration into node (gyp and node-gyp and npm are now all up to date) and then things should work much smoother.
Please also update to Visual Studio 2013 Express for Windows Desktop. In addition to the compatibility fixes in NodeJS, you'll find the new C++ compiler is improved and more standards compliant.
My apologies for the challenges you've faced. Be aware that NodeJS isn't a Microsoft supported product and much of its support is done through personal contributions off the clock. Also be aware that VS 2010 is pretty old and didn't even support x64 well in its initial release.
Thank you for the update. This has remained an obstacle to my use of NodeJS.
"you'll find the new C++ compiler is improved and more standards compliant" - an issue since Microsoft engulfed and consumed Lattice C 2.0 and spit MSC 2.0 out in its place way back in the day.
I will try the new compiler.
Anyways here is what working for me in getting node-gyp working on Windows XP, even though I really did not know it was node-gyp that was the issue till I dug further and read the install output a bit closer.
I am new to the node.js scene, so I don't know the genesis of the project. But I can say that I am a bit disappointed in all of the parts needed and that there isn't a configure-esque way of a build attempt that will fail "early and often" if the dependent sub-systems are not compatible.
I found through trial and error that I needed a non-Cygwin V2.x Python (v2.7.6 from Python.org) and VS2010 Express C++. I also installed the SP1 before trying to do anything and ran MS Update a second time just in case. I was able install Johnny-Five, but I got warnings. The node command used to install is "npm install johnny-five"
There are a bunch of "npm http GET https://xxx" statements
The node-gyp rebuild runs this in the current Windows command window
C$>node "C:\Apps\NodeJS\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
These are 2 of the 3 warning - are these something I can fix without too much trouble?
I have not encountered it in quite some time. I will try to repro at some point but I think it is resolved.
On Tue, Mar 13, 2018 at 11:50 AM Rich Trott ***@***.***> wrote: Seems like this issue is stale and probably resolved? Closable? @nodejs/node-gyp <https://github.com/orgs/nodejs/teams/node-gyp> — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#227 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABq0OMmyblSPGRyJR5Dh4ElRpQ3x-Iwks5teBT-gaJpZM4AiW3p> .
-- Bryan Smith | 206.832.9290 | brysmi