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

README.md 'How to Use' part misses important CLI argument #1149

Closed
vsemozhetbyt opened this issue Mar 18, 2017 · 7 comments
Closed

README.md 'How to Use' part misses important CLI argument #1149

vsemozhetbyt opened this issue Mar 18, 2017 · 7 comments

Comments

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Mar 18, 2017

Environment:

  • Windows 7 SP1 x64
  • Node.js 7.7.3
  • Git for Windows 2.12.0
  • Visual C++ Build Tools 2015
  • .NET Framework 4.6
  • Python 2.7.13
  • npm config set msvs_version 2015
  • cmd.exe shell

I had tried to build a small addon from node/benchmark/misc/function_call and have got an error. So I have read the advised 'Microsoft's Node.js Guidelines for Windows' (this part) and try to add --msvs_version=2015 key to the node-gyp configure. This seems to fix the problem. So maybe a remark about the node-gyp configure --msvs_version=2015 command is needed for some environments.

Output with the error (click me):
J:\temp\_git\node-fork\benchmark\misc\function_call>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.0
gyp info using node@7.7.3 | win32 | x64
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'J:\\temp\\_git\\node-fork\\benchmark\\misc\\function_call\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\vmb\\.node-gyp\\7.7.3\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\vmb\\.node-gyp\\7.7.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=J:\\temp\\_git\\node-fork\\benchmark\\misc\\function_call',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'J:\\temp\\_git\\node-fork\\benchmark\\misc\\function_call\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

J:\temp\_git\node-fork\benchmark\misc\function_call>node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.0
gyp info using node@7.7.3 | win32 | x64
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [J:\temp\_git\node-fork\benchmark\misc\function_call\build\binding.sln]
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:\Users\vmb\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:285: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 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build"
gyp ERR! cwd J:\temp\_git\node-fork\benchmark\misc\function_call
gyp ERR! node -v v7.7.3
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
Output with --msvs_version=2015 (click me):
J:\temp\_git\node-fork\benchmark\misc\function_call>node-gyp configure --msvs_version=2015
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.0
gyp info using node@7.7.3 | win32 | x64
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'J:\\temp\\_git\\node-fork\\benchmark\\misc\\function_call\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\vmb\\.node-gyp\\7.7.3\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\vmb\\.node-gyp\\7.7.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\vmb\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=J:\\temp\\_git\\node-fork\\benchmark\\misc\\function_call',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'J:\\temp\\_git\\node-fork\\benchmark\\misc\\function_call\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

J:\temp\_git\node-fork\benchmark\misc\function_call>node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.0
gyp info using node@7.7.3 | win32 | x64
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  binding.cc
  win_delay_load_hook.cc
     Creating library J:\temp\_git\node-fork\benchmark\misc\function_call\build\Release\binding.lib and object J:\temp\_git\node-fork\benchmark\misc\function_call\build\Release\binding.exp
  Generating code
  Finished generating code
  binding.vcxproj -> J:\temp\_git\node-fork\benchmark\misc\function_call\build\Release\\binding.node
  binding.vcxproj -> J:\temp\_git\node-fork\benchmark\misc\function_call\build\Release\binding.pdb (Full PDB)
gyp info ok
@vsemozhetbyt vsemozhetbyt changed the title README.md 'How to Use' part miss important cli argument README.md 'How to Use' part misses important CLI argument Mar 18, 2017
@bnoordhuis
Copy link
Member

I'd be okay with adding a line or two but it's already in the README, in the section 'Installation'.

@vsemozhetbyt
Copy link
Contributor Author

@bnoordhuis Yes, I mean there is a remark there:

If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.

However, it seems it aims some rare environment cases, while the error seems to happen in a pretty default one. But I may overestimate the defaultness of my environment :) Sorry if this is a false alarm.

@bnoordhuis
Copy link
Member

I meant the line that says:

Launch cmd, npm config set msvs_version 2015

But if you think adding it to the 'How to use' section is helpful, open a pull request and we'll take it from there.

@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Mar 20, 2017

Sorry, but I had run npm config set msvs_version 2015 and my .npmrc has this line:

msvs_version=2015

But, as you can see in the first output, the node-gyp configure still set msvs_version=auto without the --msvs_version=2015 CLI key.

@bnoordhuis
Copy link
Member

Good point. The npm config set stanza only works when node-gyp is started by npm, e.g., through npm rebuild. Documentation pull request welcome. :-)

@vsemozhetbyt
Copy link
Contributor Author

@bnoordhuis Done)

@SunshowerC
Copy link

thanks.
i was disturbed by the problem all night.

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