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

Trouble configuring node-gyp on Windows 10 64bit #1629

Closed
DragonOsman opened this issue Dec 9, 2018 · 5 comments
Closed

Trouble configuring node-gyp on Windows 10 64bit #1629

DragonOsman opened this issue Dec 9, 2018 · 5 comments

Comments

@DragonOsman
Copy link

DragonOsman commented Dec 9, 2018

  • Node Version: Node version 11.3.0 and NPM version 6.3.0
  • Platform: Windows 10 Home Single Language, Version 10.0.17134 Build 17134, 64bit
  • Compiler: C/C++ Optimizing Compiler Version 19.16.27024.1
  • Module: Hello World addon on C++ Addons tutorial on NodeJS website

node-gyp configure output (tried after doing npm config set python C:\Python27 and npm config set msvs_version=2017):

gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@11.3.0 | win32 | x64
openssl config failed: error:02001003:system library:fopen:No such process
gyp info spawn E:\v8_dev\depot_tools\python.BAT
gyp info spawn args [ 'C:\\Users\\Osman\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
�[0mgyp info spawn args   'msvs',
gyp info spawn argsThe system cannot find the path specified.
   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\programming\\Node_Addons\\hello_addon\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Osman\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Osman\\.node-gyp\\11.3.0\\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\\Osman\\.node-gyp\\11.3.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Osman\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Osman\\.node-gyp\\11.3.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\programming\\Node_Addons\\hello_addon',
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   'E:\\programming\\Node_Addons\\hello_addon\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Osman\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Osman\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd E:\programming\Node_Addons\hello_addon
gyp ERR! node -v v11.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
@richardlau
Copy link
Member

I think the issue is that python.bat is a batch file. #1582 (not yet published in a node-gyp version) implies that there was/is a problem:

This means that BAT files can be used, making node-gyp work when depot_tools is the first thing in the path.

@DragonOsman
Copy link
Author

I got it to work by running the command node-gyp configure --msvs_version=2017 --python=C:\\Python27\\python.exe, though the output:

gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@11.4.0 | win32 | x64
openssl config failed: error:02001003:system library:fopen:No such process
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\Osman\\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   'E:\\programming\\Node_Addons\\hello_addon\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Osman\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Osman\\.node-gyp\\11.4.0\\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\\Osman\\.node-gyp\\11.4.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Osman\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Osman\\.node-gyp\\11.4.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\programming\\Node_Addons\\hello_addon',
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   'E:\\programming\\Node_Addons\\hello_addon\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

shows that despite me setting msvs_version to 2017, it's still using VS2015 for some reason. Is there a way I can fix this? If so, how?

@bzoz
Copy link
Contributor

bzoz commented Dec 13, 2018

Can you run this with --verbose flag?

@manavbp
Copy link

manavbp commented May 2, 2019

I'm getting this error to on running ' NODE_ENV=dev yarn node-gyp configure --msvs_version=2017 --python=C:\Python27\python.exe --verbose '

yarn run v1.12.3                                                                                                                                                                                              
$ "C:\Users\Manav-Work\Desktop\Browser for review\safe_browser\node_modules\.bin\node-gyp" configure --msvs_version=2017 --python=C:\Python27\python.exe --verbose                                               
gyp info it worked if it ends with ok                                                                                                                                                                              
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',                                                                                                                                                              
gyp verb cli   'C:\\Users\\Manav-Work\\Desktop\\Browser for 
review\\safe_browser\\node_modules\\node-gyp\\bin\\node-gyp.js',                                                                                       
gyp verb cli   'configure',                                                                                                                                                                                        
gyp verb cli   '--msvs_version=2017',                                                                                                                                                                              
gyp verb cli   '--python=C:\\Python27\\python.exe',                                                                                                                                                                
gyp verb cli   '--verbose' ]                                                                                                                                                                                       
gyp info using node-gyp@3.8.0                                                                                                                                                                                      
gyp info using node@10.15.3 \| win32 \| x64                                                                                                                                                                          
gyp verb command configure []                                                                                                                                                                                      
gyp verb download using dist-url https://atom.io/download/atom-shell                                                                                                                                               
gyp verb check python checking for Python executable "C:\Python27\python.exe" in the PATH                                                                                                                          
gyp verb `which` succeeded C:\Python27\python.exe C:\Python27\python.exe                                                                                                                                           
gyp verb check python version `C:\Python27\python.exe -c "import sys; print "2.7.0                                                                                                                                 
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j                                                                                                                                       
gyp verb get node dir compiling against --target node version: 4.1.4                                                                                                                                               
gyp verb command install [ '4.1.4' ]                                                                                                                                                                               
gyp verb download using dist-url https://atom.io/download/atom-shell                                                                                                                                               
gyp verb install input version string "4.1.4"                                                                                                                                                                      
gyp verb install installing version: 4.1.4                                                                                                                                                                         gyp verb install --ensure was passed, so won't reinstall if already installed                                                                                                                                      
gyp verb install version is already installed, need to check "installVersion"                                                                                                                                      
gyp verb got "installVersion" 9                                                                                                                                                                                    
gyp verb needs "installVersion" 9                                                                                                                                                                                  
gyp verb install version is good                                                                                                                                                                                   
gyp verb get node dir target node version installed: 4.1.4                                                                                                                                                         
gyp verb build dir attempting to create "build" dir: C:\Users\Manav-Work\Desktop\Browser for review\safe_browser\build                                                                                             
gyp verb build dir "build" dir needed to be created? null                                                                                                                                                          gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools                                                                                                         
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.Windows10SDK.17763                                                                                                                                 
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64                                                                                                                                   
gyp verb find vs2017   - Found Microsoft.VisualStudio.VC.MSBuild.Base                                                                                                                                              
gyp verb find vs2017   - Using this installation with Windows 10 SDK                                                                                                                                               
gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools                                                                                                            
gyp verb build/config.gypi creating config file                                                                                                                                                                    
gyp verb build/config.gypi writing out config file: C:\Users\Manav-Work\Desktop\Browser for review\safe_browser\build\config.gypi                                                                                  
gyp verb config.gypi checking for gypi file: C:\Users\Manav-Work\Desktop\Browser for review\safe_browser\config.gypi                                                                                               
gyp verb common.gypi checking for gypi file: C:\Users\Manav-Work\Desktop\Browser for review\safe_browser\common.gypi                                                                                               
gyp verb gyp gyp format was not specified; forcing "msvs"                                                                                                                                                          
gyp info spawn C:\Python27\python.exe                                                                                                                                                                              
gyp info spawn args [ 'C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser\\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   'C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser\\build\\config.gypi',                                                                                                      
gyp info spawn args   '-I',                                                                                                                                                                                        
gyp info spawn args   'C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser\\node_modules\\node-gyp\\addon.gypi',                                                                                      
gyp info spawn args   '-I',                                                                                                                                                                                        
gyp info spawn args   'C:\\Users\\Manav-Work\\.node-gyp\\4.1.4\\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\\Manav-Work\\.node-gyp\\4.1.4',                                                                                                                                   
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser\\node_modules\\node-gyp',                                                                                   
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Manav-Work\\.node-gyp\\4.1.4\\<(target_arch)\\node.lib',                                                                                                         gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser',                                                                                                        
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   'C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser\\build',                                                                                                                   
gyp info spawn args   '-Goutput_dir=.' ]                                                                                                                                                                           
gyp: binding.gyp not found (cwd: C:\Users\Manav-Work\Desktop\Browser for review\safe_browser) while trying to load binding.gyp                                                                                     
gyp ERR! configure error                                                                                                                                                                                           
gyp ERR! stack Error: `gyp` failed with exit code: 1                                                                                                                                                               
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Manav-Work\Desktop\Browser for review\safe_browser\node_modules\node-gyp\lib\configure.js:345:16)                                                            
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)                                                                                                                                                         
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)                                                                                                                       
gyp ERR! System Windows_NT 10.0.17134                                                                                                                                                                              
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Manav-Work\\Desktop\\Browser for review\\safe_browser\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--
msvs_version=2017" "--python=C: \\Python27\\python.exe" "--verbose"                                                                                                                                                                                
gyp ERR! cwd C:\Users\Manav-Work\Desktop\Browser for review\safe_browser                                                                                                                                           
gyp ERR! node -v v10.15.3                                                                                                                                                                                          
gyp ERR! node-gyp -v v3.8.0                                                                                                                                                                                        
gyp ERR! not ok                                                                                                                                                                                                    error Command failed with exit code 1.                                                                                                                                                                             
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@rvagg
Copy link
Member

rvagg commented Jun 20, 2019

closing due to staleness, @manavbp do you still have this problem, @bzoz do you have anything jumping out at you here? maybe a yarn-specific thing.

@rvagg rvagg closed this as completed Jun 20, 2019
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

5 participants