Cannot install dependencies on windows after cloning directory
Neurrone opened this issue · 4 comments
Describe the bug
There's a compilation error about missing v8.h when trying to run yarn
.
To Reproduce
- Run
yarn
when in the project folder to install.
Expected behavior
The dependencies install successfully
I first see the following error:
npm ERR! code ELSPROBLEMS
npm ERR! invalid: register-scheme@0.0.2 D:\source\sonixd\node_modules\register-scheme
{
"error": {
"code": "ELSPROBLEMS",
"summary": "invalid: register-scheme@0.0.2 D:\\source\\sonixd\\node_modules\\register-scheme",
"detail": ""
}
}
This is followed by:
$ node -r @babel/register .erb/scripts/CheckNativeDep.js && electron-builder install-app-deps && yarn cross-env NODE_ENV=development webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.babel.js && opencollective-postinstall && yarn-deduplicate yarn.lock
Native dependencies could not be checked
• electron-builder version=22.10.5
• loaded configuration file=package.json ("build" field)
• installing production dependencies platform=win32 arch=x64 appDir=D:\source\sonixd\src
⨯ C:\Program Files\nodejs\node.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Output:
Output:
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error output:
Error output:
error D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media.playback: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media.playback
Output:
D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media.playback>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.14.0 | win32 | x64
gyp info find Python using Python version 3.10.1 found at "C:\Users\Dickson\.pyenv\pyenv-win\versions\3.10.1\python3.exe"
gyp info find VS using VS2022 (17.0.32112.339) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\Dickson\.pyenv\pyenv-win\versions\3.10.1\python3.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\Dickson\\AppData\\Roaming\\nvm\\v16.14.0\\node_modules\\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 '-I',
gyp info spawn args 'D:\\source\\sonixd\\src\\node_modules\\@nodert-win10-au\\windows.media.playback\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\\source\\sonixd\\src\\node_modules\\@nodert-win10-au\\windows.media.playback\\common.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Dickson\\AppData\\Roaming\\nvm\\v16.14.0\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Dickson\\.electron-gyp\\13.6.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\\Dickson\\.electron-gyp\\13.6.3',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Dickson\\AppData\\Roaming\\nvm\\v16.14.0\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Dickson\\\\.electron-gyp\\\\13.6.3\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=D:\\source\\sonixd\\src\\node_modules\\@nodert-win10-au\\windows.media.playback',
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:\\source\\sonixd\\src\\node_modules\\@nodert-win10-au\\windows.media.playback\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
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 info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
_nodert_generated.cpp
D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media.playback\_nodert_generated.cpp(19,10): fatal error C1083: Cannot open include file: 'v8.h': No such file or directory [D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media.playback\build\binding.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Dickson\AppData\Roaming\nvm\v16.14.0\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:520:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media.playback
gyp ERR! node -v v16.14.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
Desktop (please complete the following information):
- OS: Windows 10 10.0.19044.1526]
- Version latest master
Additional context
Add any other context about the problem here.
The NodeRT Windows native-dependency was added in the previous release which made setting up the dev environment a bit more tricky on Windows (and I haven't updated the README yet).
Here's some steps that I used:
- Installed nodejs including the optional build dependencies from the installer (Alternatively you can install VS Build tools separately, though it may or may not work properly)
- Install nvm and force npm to use 14.16.1
- Install yarn globally
- Install Windows 10 SDK 10.0.14393.0 (this is required for
nodert-win10-au
) - (May or may not need this step) Copy platform.winmd from
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\lib\x86\store\references
toC:\Program Files (x86)\Windows Kits\10\UnionMetadata
(Needs both platform.winmd and Windows.winmd in that folder)
After doing the above, do this in the following order (the github publish action is using this):
cd
to thesrc
folder of the repo and runyarn --frozen-lockfile --ignore-scripts --network-concurrency 1 --network-timeout 300000
cd
to the root folder of the repo and runyarn install --frozen-lockfile --ignore-scripts --prefer-offline --network-concurrency 1 --network-timeout 300000
- in the root folder of the repo run
yarn install --frozen-lockfile --prefer-offline --network-concurrency 1 --network-timeout 300000
After that, you should be able to run with yarn start
If you receive an error with Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
, cd
to the node_modules/electron
directory and run node install.js
to install it
I get the following error:
d:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media\opaquewrapper.h(18): fatal error C1083: Cannot open include file: 'node.h': No such file or directory (compiling source file ..\OpaqueWrapper.cpp) [D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media\build\binding.vcxproj]
d:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media\nodertutils.h(18): fatal error C1083: Cannot open include file: 'v8.h': No such file or directory (compiling source file ..\NodeRtUtils.cpp) [D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media\build\binding.vcxproj]
d:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media\_nodert_generated.cpp(19): fatal error C1083: Cannot open include file: 'v8.h': No such file or directory [D:\source\sonixd\src\node_modules\@nodert-win10-au\windows.media\build\binding.vcxproj]
I'm finding it incredibly difficult to set up. What is that package being used for?
It handles the (optional) Windows media controls API that was added in #171. You can remove the packages from /src/package.json
and comment out 283-379 the section on src/main.dev.js
if you're having trouble getting it to build.
Lines 17 to 20 in 85bd3d3
Lines 283 to 379 in 85bd3d3
Also you could try deleting your node_modules
folder, running yarn cache clean
and deleting the C:\Users\$yourUsername\.electron-gyp
folder and then try rebuilding.
Thanks, commenting / removing the packages works.
Any way this could be made an optional dependency to make the setup easier? So that only people who're working on that feature need to have that configured?