简体   繁体   English

React Native项目初始化错误(Windows)

[英]React Native project init error (windows)

Trying to execute react-native init AwesomeProject but i get a frustrating error: 尝试执行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]

I have installed: Visual C++ Build tools 2015 Node.js - 6.2.2 Python 2.7 node-gyp 3.3.1 我已经安装了:Visual C ++ Build tools 2015 Node.js-6.2.2 Python 2.7 node-gyp 3.3.1

Really appreciate your help! 非常感谢您的帮助!

Ok , thanks to the user "Ramhound" problem is solved. 好的,感谢用户“ Ramhound”的问题得以解决。 What i did: 我做了什么:

  1. Reinstalled visual c++ build tools 2015 while fixing their missing parts using links from here 重新安装了Visual C ++构建工具2015,同时使用此处的链接修复了缺失的部分

  2. Pointing out MSBuild.exe location in environment variables "PATH" variable. 指出环境变量“ PATH”变量中的MSBuild.exe位置。

  3. Updating node.js and node-gyp to the latest version using npm -g install npm@next 使用npm -g install npm@next node.js和node-gyp更新到最新版本

Run : 跑 :

npm cache clean npm缓存清理

also verify python must be in your path variables. 还要验证python必须在您的路径变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM