Skip to content

Error when building on Windows with Python install dir having space in path #4840

Description

@felixfbecker

This is the first time I tried to build node from source, when I try to run vcbuild I get this log:

Looking for Visual Studio 2015
Found Visual Studio 2015
configure  --dest-cpu=x86 --tag=
ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles.
creating  icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'host_arch': 'x64',
                 'icu_small': 'false',
                 'node_byteorder': 'little',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'true',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'python': 'C:\\Program Files\\Python\\2.7\\python.exe',
                 'target_arch': 'ia32',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 1}}
creating  config.gypi
creating  config.mk
Project files generated.
  gtest.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\gtest.lib
  cares.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\cares.lib
  http_parser.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\http_parser.lib
  libuv.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\libuv.lib
  node_js2c
  Command "C:\Program" not found
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\felix\git\opensource\node\node_js2c.vcxproj]
  v8_base_0.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_0.lib
  v8_base_2.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_2.lib
  v8_base_1.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_1.lib
  v8_libplatform.vcxproj -> ..\..\..\..\build\Release\lib\v8_libplatform.lib
  v8_libbase.vcxproj -> ..\..\..\..\build\Release\lib\v8_libbase.lib
  zlib.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\zlib.lib
  v8_base_3.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_3.lib
  openssl.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\openssl.lib

See the line "C:\Progam" not found, it seems like something from C:\Program Files is run but the path is not quoted. I looked at the bat I could not find what is causing this. I don't get any node.exe output. I am using Visual Studio 2015 Update 1 on Windows 10 64 bit.

Activity

  1. added
    windowsIssues and PRs related to the Windows platform.
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Jan 24, 2016
  2. r-52 commented on Jan 24, 2016

    @r-52
    Contributor

    cc @nodejs/platform-windows

  3. seishun commented on Jan 24, 2016

    @seishun
    Contributor

    It seems you have Python installed in C:\Program Files. I guess this line needs quotes.

  4. felixfbecker commented on Jan 24, 2016

    @felixfbecker
    ContributorAuthor

    @seishun Yeah. All my programs are installed in Program Files.

  5. felixfbecker commented on Jan 24, 2016

    @felixfbecker
    ContributorAuthor

    But it's also in the PATH

  6. seishun commented on Jan 24, 2016

    @seishun
    Contributor

    Could you try adding quotes in the line I linked? It should look like '"<(python)"',.

  7. seishun commented on Jan 24, 2016

    @seishun
    Contributor

    This one:

    node/node.gyp

    Line 528 in 3e2a2e6

    '<(python)',

  8. benjamingr commented on Jan 24, 2016

    @benjamingr
    Member

    @felixfbecker in your PATH, see this guide for setting up path variables.

    Basically, it's looking for Python in C:\Program because Program Files contains a space. You need to quote that.

    This has not been a problem before since Python defaults to install in C:\Python27.

  9. seishun commented on Jan 24, 2016

    @seishun
    Contributor

    @benjamingr you don't need quotes in PATH, and according to his build output his Python installation is found just fine.

  10. felixfbecker commented on Jan 24, 2016

    @felixfbecker
    ContributorAuthor

    @benjamingr I know how to setup path, thanks :)
    @seishun That fixed it. Should I do a PR?

  11. seishun commented on Jan 24, 2016

    @seishun
    Contributor

    @felixfbecker I think so. But it makes me wonder why GYP isn't doing its job properly by escaping the path on its own.

  12. felixfbecker commented on Jan 24, 2016

    @felixfbecker
    ContributorAuthor

    @benjamingr I dislike programs that install to C:\. It is the equivalent of installing Linux programs in the root path. You wouldnt install python to /python-27, would you? :D

  13. silverwind commented on Jan 24, 2016

    @silverwind
    Contributor

    This issue has come up a few times now. Can we possibly fix it by quoting that path somewhere?

  14. felixfbecker commented on Jan 24, 2016

    @felixfbecker
    ContributorAuthor
  15. changed the title [-]Error when building on Windows[/-] [+]Error when building on Windows with Python install dir having space in path[/+] on Jan 24, 2016
  16. benjamingr commented on Jan 24, 2016

    @benjamingr
    Member

    @felixfbecker well, Program Files isn't much better IMO :D I was only addressing why this isn't broken for most users though, what you're asking for is legit.

  17. felixfbecker commented on Jan 24, 2016

    @felixfbecker
    ContributorAuthor

    @benjamingr Program Files is where you install programs (for all users) on Windows... like /usr/local on Linux (I think).

  18. silverwind commented on Jan 24, 2016

    @silverwind
    Contributor

    Closing this issue as it's a dupe of #4012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions