开花豆-程序人生942 2022-10-06 11:01 采纳率: 60%
浏览 39
已结题

关于#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
  • 写回答

1条回答 默认 最新

  • 犬莱八荒 2022-10-08 08:54
    关注

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

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 5月5日
  • 创建了问题 10月6日

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c