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

Install packages failed with only VS2019 installed #8065

Closed
rayncc opened this issue Jun 20, 2020 · 6 comments
Closed

Install packages failed with only VS2019 installed #8065

rayncc opened this issue Jun 20, 2020 · 6 comments
Labels
question user / developer questions 🤔 needs more info issues that require more info from the author

Comments

@rayncc
Copy link

rayncc commented Jun 20, 2020

Bug Description:

Failed with errors below:

error D:\Dev\GitHub\theia\node_modules\@theia\electron: Command failed.
Exit code: 127
Command: node scripts/post-install.js
Arguments:
Directory: D:\Dev\GitHub\theia\node_modules\@theia\electron
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.13.0 | win32 | x64
gyp info spawn D:\Softwares\Anaconda3\envs\py27\python.EXE
gyp info spawn args [ 'D:\\Dev\\GitHub\\theia\\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   'D:\\Dev\\GitHub\\theia\\node_modules\\@theia\\electron\\native\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Dev\\GitHub\\theia\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\RMay\\.node-gyp\\10.13.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\\RMay\\.node-gyp\\10.13.0',
gyp info spawn args   '-Dnode_gyp_dir=D:\\Dev\\GitHub\\theia\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\RMay\\.node-gyp\\10.13.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\Dev\\GitHub\\theia\\node_modules\\@theia\\electron\\native',
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   'D:\\Dev\\GitHub\\theia\\node_modules\\@theia\\electron\\native\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.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' ]
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:407:16)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "D:\\Softwares\\NodeJs\\node.exe" "D:\\Dev\\GitHub\\theia\\node_modules\\@theia\\electron\\node-gyp-cli.js" "rebuild"
gyp ERR! cwd D:\Dev\GitHub\theia\node_modules\@theia\electron\native
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.                                                                                                                                                                                                                                                   gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>

Steps to Reproduce:

1.An PC with only vs2019 installed.
2.yarn

Additional Information

Theia version: lastest master branch.

Change the node-gyp version in 'dev-packages/electron' to 5.1.0 or above will work:

 "dependencies": {
    "electron": "^4.2.11",
    "electron-download": "^4.1.1",
    "electron-store": "^2.0.0",
    "fix-path": "^2.1.0",
    "native-keymap": "^1.2.5",
    "node-gyp": "^5.1.0",      // change this to 5.1.0 or above
    "unzipper": "^0.9.11",
    "yargs": "^11.1.0"
  },
@rayncc rayncc changed the title make the source codes wort with VS2019 Install packages failed with only VS2019 installed Jun 20, 2020
@vince-fugnitto
Copy link
Member

@rayncc thank you for the issue! Can you make sure you've installed the necessary prerequisites, namely the following should fix the issue:

sudo apt-get install build-essential

I'm not sure which operating system you are using however as it is not described.

@vince-fugnitto vince-fugnitto added the 🤔 needs more info issues that require more info from the author label Jun 20, 2020
@rayncc
Copy link
Author

rayncc commented Jun 21, 2020

@rayncc thank you for the issue! Can you make sure you've installed the necessary prerequisites, namely the following should fix the issue:

sudo apt-get install build-essential

I'm not sure which operating system you are using however as it is not described.

I'm working on Windows platform, so...
I don't want to install vs2015, and here are what I've installed:
image

I think it's a bug of node-gyp 3.8.0, which is used by dev-packages/electron. See:
nodejs/node-gyp#1663

I changed the node-gyp version and it worked. But I don't know whether the change will affect other packages, still trying...

BTW, I've tried to install Microsoft Build Tools 2015/2017, or 'npm install windows-build-tools', they won't work

@vince-fugnitto
Copy link
Member

@rayncc thank you for the issue! Can you make sure you've installed the necessary prerequisites, namely the following should fix the issue:

sudo apt-get install build-essential

I'm not sure which operating system you are using however as it is not described.

I'm working on Windows platform...

@rayncc there are windows specific build instructions. I’m not sure why you mentioned ‘Visual Studio’ but is not necessary in order to successfully build (for example I don’t have it installed nor do colleges which build on Windows).

@akosyakov akosyakov added the question user / developer questions label Jun 22, 2020
@rayncc
Copy link
Author

rayncc commented Jun 22, 2020

@rayncc thank you for the issue! Can you make sure you've installed the necessary prerequisites, namely the following should fix the issue:

sudo apt-get install build-essential

I'm not sure which operating system you are using however as it is not described.

I'm working on Windows platform...

@rayncc there are windows specific build instructions. I’m not sure why you mentioned ‘Visual Studio’ but is not necessary in order to successfully build (for example I don’t have it installed nor do colleges which build on Windows).

I also make apps with .net, so I need to install visual studio 2019. and vs2019 have already provided build tools that node-gyp needs.
take a look at the error logs:

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT

node-gyp tried to locate MSBuild.exe, but with vs2019, the correct path is:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe 

this is fixed by node-gyp at version 5.1.0

@kittaakos
Copy link
Contributor

I can confirm the initial issue. I had to force building a theia-based app with the windows-2016 image on GH Actions. However, #8216 was merged, and the current node-gyp version is 7.0.0. @rayncc, can you please try it again with the HEAD of the master? The issue should be fixed for envs with VS2019.

@rayncc
Copy link
Author

rayncc commented Sep 22, 2020

I can confirm the initial issue. I had to force building a theia-based app with the windows-2016 image on GH Actions. However, #8216 was merged, and the current node-gyp version is 7.0.0. @rayncc, can you please try it again with the HEAD of the master? The issue should be fixed for envs with VS2019.

Tried and done. It's fixed. Thanks alot

@rayncc rayncc closed this as completed Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question user / developer questions 🤔 needs more info issues that require more info from the author
Projects
None yet
Development

No branches or pull requests

4 participants