当前位置:   article > 正文

node报错_gyp err! system windows_nt 10.0.19044

gyp err! system windows_nt 10.0.19044

记录bug:

运行 npx -p @storybook/cli sb init 时报错

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 '/nologo',

gyp info spawn args '/p:Configuration=Release;Platform=x64'

gyp info spawn args ]

�ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�-m�����ء�

��������ʱ��Ϊ 2023-02-24 19:31:19��

�ڵ� 1 �ϵ���Ŀ��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.sln��(Ĭ��Ŀ��)��

ValidateSolutionConfiguration:

�������ɽ���������á�Release|x64����

��Ŀ��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.sln��(1)���ڽڵ� 1 �����ɡ�D:\vs-vue\1-ui-repository\react\malre

d-ui-ts\node_modules\node-sass\build\binding.vcxproj.metaproj��(2) (Ĭ��Ŀ��)��

��Ŀ��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.vcxproj.metaproj��(2)���ڽڵ� 1 �����ɡ�D:\vs-vue\1-ui-repositor

y\react\malred-ui-ts\node_modules\node-sass\build\src\libsass.vcxproj��(3) (Ĭ��Ŀ��)��

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: �Ҳ��� Windows SDK �汾

10.0.19041.0���밲װ����汾�� Windows SDK����������Ŀ����ҳ�л�ͨ���Ҽ��������������ѡ���ض��������Ŀ�ꡱ������ SDK

�汾�� [D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\src\libsass.vcxproj]

�����������Ŀ��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\src\libsass.vcxproj��(Ĭ��Ŀ��)�IJ��� - ʧ�ܡ�

�����������Ŀ��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.vcxproj.metaproj��(Ĭ��Ŀ��)�IJ��� - ʧ�ܡ�

�����������Ŀ��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.sln��(Ĭ��Ŀ��)�IJ��� - ʧ�ܡ�

����ʧ�ܡ�

��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.sln��(Ĭ��Ŀ��) (1) ->

��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\binding.vcxproj.metaproj��(Ĭ��Ŀ��) (2) ->

��D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\src\libsass.vcxproj��(Ĭ��Ŀ��) (3) ->

(_CheckWindowsSDKInstalled Ŀ��) ->

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: �Ҳ��� Windows SDK �

汾 10.0.19041.0���밲װ����汾�� Windows SDK����������Ŀ����ҳ�л�ͨ���Ҽ��������������ѡ���ض��������Ŀ�ꡱ������

SDK �汾�� [D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass\build\src\libsass.vcxproj]

0 ������

1 ������

����ʱ�� 00:00:00.28

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 (D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-gyp\lib\build.js:194:23)

gyp ERR! stack at ChildProcess.emit (node:events:513:28)

gyp ERR! stack at 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" "D:\\vs-vue\\1-ui-repository\\react\\malred-ui-ts\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--ver

bose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="

gyp ERR! cwd D:\vs-vue\1-ui-repository\react\malred-ui-ts\node_modules\node-sass

gyp ERR! node -v v18.13.0

原因: 好像是因为找不到window的sdk:

error MSB8036: �Ҳ��� Windows SDK �

汾 10.0.19041.0���밲װ����汾�� Windows SDK����������Ŀ����ҳ�л�ͨ���Ҽ��������������ѡ���ض��������Ŀ�ꡱ������

gyp ERR! System Windows_NT 10.0.19044

解决: 安装对应sdk

在这里下对应sdk

https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/

再次运行, 成功

yarn install v1.22.19

warning ..\..\..\package.json: No license field

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid re

solution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

[1/4] Resolving packages...

success Already up-to-date.

Done in 1.10s.

. ✓

� checking possible migrations..

Found builder @storybook/builder-webpack5, skipping

Found builder @storybook/builder-webpack5, skipping

✅ migration check successfully ran

To run your Storybook, type:

yarn storybook

For more information visit: https://storybook.js.org

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/82744
推荐阅读
相关标签
  

闽ICP备14008679号