关于#npm#的问题,如何解决?

#npm安装better-sqlite3报错

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code 1
npm ERR! path D:\DiskParts\数据管理系统\server\node_modules\better-sqlite3
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || npm run build-release
npm ERR! > better-sqlite3@7.6.2 build-release
npm ERR! > node-gyp rebuild --release
npm ERR!
npm ERR! �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء�
npm ERR!   copy_builtin_sqlite3
npm ERR! cl : ������ warning D9002: ����δ֪ѡ�/Zc:__cplusplus�� [D:\DiskParts\���ݹ���ϵͳ\server\node_modules\better-sqlite3\build\deps\sqlite3.vcxproj]
npm ERR!   sqlite3.c
npm ERR! C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmmintrin.h(79): fatal error C1083: �޷��򿪰����ļ�:   ��malloc.h��: No such file or directory [D:\DiskParts\���ݹ���ϵͳ\server\node_modules\better-sqlite3\build\deps\sqlite3.vcxproj]
npm ERR! prebuild-install warn install connect ECONNREFUSED 127.0.0.1:443
npm ERR! npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.16.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.0 found at "C:\Program Files\Python310\python.exe"
npm ERR! gyp info find VS using VS2015 (14.0) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Program Files\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\better-sqlite3\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\16.16.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\16.16.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.16.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\DiskParts\\数据管理系统\\server\\node_modules\\better-sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\better-sqlite3\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (D:\DiskParts\数据管理系统\server\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "D:\\DiskParts\\数据管理系统\\server-runtime\\node.exe" "D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd D:\DiskParts\数据管理系统\server\node_modules\better-sqlite3
npm ERR! gyp ERR! node -v v16.16.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-10-06T02_55_34_406Z-debug-0.log

D:\DiskParts\数据管理系统\server>npm install --save better-sqlite3
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code 1
npm ERR! path D:\DiskParts\数据管理系统\server\node_modules\better-sqlite3
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || npm run build-release
npm ERR! > better-sqlite3@7.6.2 build-release
npm ERR! > node-gyp rebuild --release
npm ERR!
npm ERR! �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء�
npm ERR!   copy_builtin_sqlite3
npm ERR! cl : ������ warning D9002: ����δ֪ѡ�/Zc:__cplusplus�� [D:\DiskParts\���ݹ���ϵͳ\server\node_modules\better-sqlite3\build\deps\sqlite3.vcxproj]
npm ERR!   sqlite3.c
npm ERR! C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmmintrin.h(79): fatal error C1083: �޷��򿪰����ļ�:   ��malloc.h��: No such file or directory [D:\DiskParts\���ݹ���ϵͳ\server\node_modules\better-sqlite3\build\deps\sqlite3.vcxproj]
npm ERR! prebuild-install warn install connect ECONNREFUSED 127.0.0.1:443
npm ERR! npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.16.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.0 found at "C:\Program Files\Python310\python.exe"
npm ERR! gyp info find VS using VS2015 (14.0) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Program Files\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\better-sqlite3\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\16.16.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\16.16.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.16.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=D:\\DiskParts\\数据管理系统\\server\\node_modules\\better-sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'D:\\DiskParts\\数据管理系统\\server\\node_modules\\better-sqlite3\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (D:\DiskParts\数据管理系统\server\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "D:\\DiskParts\\数据管理系统\\server-runtime\\node.exe" "D:\\DiskParts\\数据管理系统\\server\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd D:\DiskParts\数据管理系统\server\node_modules\better-sqlite3
npm ERR! gyp ERR! node -v v16.16.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-10-06T02_58_48_925Z-debug-0.log

node版本高了,需要降低版本
https://blog.csdn.net/qq_42581563/article/details/125917585 您看下