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

error D:\vscode-main\node_modules\@vscode\sqlite3: Command failed. #152839

Closed
bfzx opened this issue Jun 22, 2022 · 4 comments
Closed

error D:\vscode-main\node_modules\@vscode\sqlite3: Command failed. #152839

bfzx opened this issue Jun 22, 2022 · 4 comments
Assignees

Comments

@bfzx
Copy link

bfzx commented Jun 22, 2022

  • VS Code Version: vscode-main
  • OS Version:Windows 10
    error D:\vscode-main\node_modules@vscode\sqlite3: Command failed.
    Exit code: 1
    Command: node-gyp rebuild
    Arguments:
    Directory: D:\vscode-main\node_modules@vscode\sqlite3
    Output:
    D:\vscode-main\node_modules@vscode\sqlite3>if not defined npm_config_node_gyp (node "D:\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@9.0.0
    gyp info using node@16.15.1 | win32 | ia32
    gyp info find Python using Python version 3.8.6 found at "C:\Program Files\python\python.exe"
    gyp info find VS using VS2017 (15.9.28307.2019) found at:
    gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
    gyp info find VS run with --verbose for detailed information
    gyp info spawn C:\Program Files\python\python.exe
    gyp info spawn args [
    gyp info spawn args 'D:\nodejs\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:\vscode-main\node_modules\@VScode\sqlite3\build\config.gypi',
    gyp info spawn args '-I',
    gyp info spawn args 'D:\nodejs\node_modules\npm\node_modules\node-gyp\addon.gypi',
    gyp info spawn args '-I',
    gyp info spawn args 'C:\Users\DELL\AppData\Local\node-gyp\Cache\18.3.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\DELL\AppData\Local\node-gyp\Cache\18.3.4',
    gyp info spawn args '-Dnode_gyp_dir=D:\nodejs\node_modules\npm\node_modules\node-gyp',
    gyp info spawn args '-Dnode_lib_file=C:\\Users\\DELL\\AppData\\Local\\node-gyp\\Cache\\18.3.4\\<(target_arch)\\node.lib',
    gyp info spawn args '-Dmodule_root_dir=D:\vscode-main\node_modules\@VScode\sqlite3',
    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:\vscode-main\node_modules\@VScode\sqlite3\build',
    gyp info spawn args '-Goutput_dir=.'
    gyp info spawn args ]
    gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\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=Win32'
    gyp info spawn args ]
    �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء�
    unpack_sqlite_dep
    'C:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij���
    ���������ļ���
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: ��cmd.exe�����˳�������Ϊ 1�� [D:\vscode-main\node_modules@vscode\sqlite3\build\deps\action_before_build.vcxproj]
    nothing.c
    win_delay_load_hook.cc
    nothing.vcxproj -> D:\vscode-main\node_modules@vscode\sqlite3\build\Release\nothing.lib
    gyp ERR! build error
    gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
    gyp ERR! stack at ChildProcess.onExit (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
    gyp ERR! stack at ChildProcess.emit (node:events:527: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 "D:\nodejs\node.exe" "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
    gyp ERR! cwd D:\vscode-main\node_modules@vscode\sqlite3
@Tyriar Tyriar assigned deepak1556 and unassigned Tyriar Jun 22, 2022
@zhuhe25
Copy link

zhuhe25 commented Jun 27, 2022

I have the same problem, I've been successful before

@roma160
Copy link

roma160 commented Jul 11, 2022

Recently encountered SIMILAR (not the same error):

error C:\buff\vscode_compile_error\node_modules\@vscode\sqlite3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\buff\vscode_compile_error\node_modules\@vscode\sqlite3
Output:
C:\buff\vscode_compile_error\node_modules\@vscode\sqlite3>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@9.0.0
gyp info using node@16.16.0 | win32 | x64
gyp info find Python using Python version 3.9.7 found at "C:\Program Files\Python\Python39\python.exe"
gyp info find VS using VS2019 (16.11.31729.503) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Program Files\Python\Python39\python.exe
gyp info spawn args [
gyp info spawn args   'C:\\Program Files\\nodejs\\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   'C:\\buff\\vscode_compile_error\\node_modules\\@vscode\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\<my_username>\\AppData\\Local\\node-gyp\\Cache\\18.3.5\\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\\<my_username>\\AppData\\Local\\node-gyp\\Cache\\18.3.5',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\<my_username>\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.3.5\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\buff\\vscode_compile_error\\node_modules\\@vscode\\sqlite3',
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:\\buff\\vscode_compile_error\\node_modules\\@vscode\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\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.
  unpack_sqlite_dep
  'C:\Program' is not recognized as an internal or external command,
  operable program or batch file.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for '..\..\deps\sqlite-autoconf-3360000.tar.gz' exited with code 1. [C:\buff\vscode_compile_error\node_modules\@vscode\sqlite3\build\deps\action_before_build.vcxproj]
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> C:\buff\vscode_compile_error\node_modules\@vscode\sqlite3\build\Release\\nothing.lib
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.22000
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 C:\buff\vscode_compile_error\node_modules\@vscode\sqlite3

Take special attention to this line: 'C:\Program' is not recognized as an internal or external command,

As I have Python and some other things installed to the folder C:\Program Files\, other programs often fail to interpret this path.

Things I've done for fixing

I just created python venv inside the root of the project:

python -m venv ./.venv
# This command will depend on your platform
./.venv/Scripts/activate

And then restarted the build process by running yarn. Everything compiled successfully.

@FuPeiJiang
Copy link

FuPeiJiang commented Aug 19, 2022

'C:\Program' is not recognized as an internal or external command,

it'll work if you change deps/sqlite3.gyp line 65:

'<!(node -p "process.env.PYTHON")'

to

'"<!(node -p "process.env.PYTHON")"'

FuPeiJiang/npm--vscode-sqlite3@4c2fa86

but since yarn resets files, your changes are gone

Yarn will completely replace the contents of your node_modules with freshly unpackaged modules.

https://yarnpkg.com/package/patch-package#:~:text=Yarn%20will%20completely%20replace%20the%20contents%20of%20your%20node_modules%20with%20freshly%20unpackaged%20modules.

so test with this:
https://github.com/FuPeiJiang/vscode/tree/vscode-sqlite3

the reason I made a separate repo: https://github.com/FuPeiJiang/npm--vscode-sqlite3
is because https://www.npmjs.com/package/@vscode/sqlite3 doesn't have a repo, so nowhere to contribute changes
why was https://www.npmjs.com/package/sqlite3 forked ?
for performance ? I see that dependency: "@mapbox/node-pre-gyp": "^1.0.0", is removed

note that sqlite3 was updated from ./extract.py to ./extract.js
TryGhost/node-sqlite3#1570
so my "fix" is totally useless if we merge with sqlite3, but again, no repo

FuPeiJiang added a commit to FuPeiJiang/vscode-node-sqlite3 that referenced this issue Aug 21, 2022
microsoft/vscode#152839 (comment)
'C:\Program' is not recognized as an internal or external command,`
@deepak1556
Copy link
Collaborator

Please try the latest version, this should now be addressed with microsoft/vscode-node-sqlite3@8db96d4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants