【问题标题】:React Native project init error (windows)React Native 项目初始化错误(windows)
【发布时间】:2016-07-07 11:26:56
【问题描述】:

试图执行react-native init AwesomeProject 但我得到一个令人沮丧的错误:

> utf-8-validate@1.2.1 install C:\Users\Yuval\AwesomeProject\node_modules\utf-8-validate
> node-gyp rebuild

C:\Users\**myName**\AwesomeProject\node_modules\utf-8-validate>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 )
        Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
        C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
         MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
        ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\**myName**\
AwesomeProject\node_modules\utf-8-validate\build\validation.vcxproj]

我已经安装了: Visual C++ 构建工具 2015 Node.js - 6.2.2 蟒蛇 2.7 节点gyp 3.3.1

非常感谢您的帮助!

【问题讨论】:

  • 您的系统上似乎没有安装 Windows SDK 8.1 版。你试过安装吗?
  • 实际安装了Windows SDK 8.1,我也在注册表中检查了..
  • Visual Studio 根据错误认为不同
  • 好吧,我设法重新安装,似乎这个错误已经消失,但现在我得到一个“找不到”msbuild.exe“”错误..

标签: node.js reactjs npm react-native


【解决方案1】:

好的,感谢用户“Ramhound”问题解决了。 我做了什么:

  1. 重新安装了 Visual c++ 构建工具 2015,同时使用来自 here 的链接修复了缺失的部分

  2. 指出环境变量“PATH”变量中的 MSBuild.exe 位置。

  3. 使用npm -g install npm@next 将 node.js 和 node-gyp 更新到最新版本

【讨论】:

    【解决方案2】:

    运行:

    npm 缓存清理

    还要验证 python 必须在你的路径变量中。

    【讨论】:

      猜你喜欢
      • 2022-08-17
      • 1970-01-01
      • 1970-01-01
      • 2020-04-02
      • 1970-01-01
      • 1970-01-01
      • 2023-02-01
      • 2015-05-31
      • 2021-06-12
      相关资源
      最近更新 更多