【问题标题】:React-Native: Use SQlite Database ifor Android on WindowsReact-Native:在 Windows 上为 Android 使用 SQlite 数据库
【发布时间】:2015-12-10 08:39:01
【问题描述】:

我正在React-Nativehave SQLite Database 中尝试演示应用程序。但按照link 的建议,我在项目的主存储库中运行命令npm install --save react-native-sqlite-storage,但我在Windows 上遇到以下错误,但相同的命令在Mac 上运行完美.. 那么Windows 有什么问题.. 请帮助我..

D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo>npm install --save react-native-s
qlite-storage
npm WARN install Couldn't install optional dependency: Unsupported

> bufferutil@1.2.1 install D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_m
odules\bufferutil
> node-gyp rebuild


D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_modules\bufferutil>if not de
fined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\no
de-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.
MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
 If the component is not installed, either 1) install the Microsoft Windows SDK
 for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
 Studio 2008.  [D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_modules\buf
ferutil\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_modules\bufferu
til
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:bufferutil bufferutil@1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil Exit status 1

> utf-8-validate@1.2.1 install D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\no
de_modules\utf-8-validate
> node-gyp rebuild


D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_modules\utf-8-validate>if no
t defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bi
n\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (no
de  rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe".
 If the component is not installed, either 1) install the Microsoft Windows SDK
 for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual
 Studio 2008.  [D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_modules\utf
-8-validate\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo\node_modules\utf-8-v
alidate
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate utf-8-validate@1.2.1 install: `node-gyp rebuild`

npm WARN install:utf-8-validate Exit status 1
RNSQLiteDemo@0.0.1 D:\ReactNative Study\RNSQLiteDemo\RNSQLiteDemo
└── react-native-sqlite-storage@2.1.1

【问题讨论】:

标签: android node.js windows sqlite react-native


【解决方案1】:

这可能是您在 Windows 上的本地 node.js 版本的问题吗?该软件包中没有任何内容需要任何额外的调整,因此我真的很想说这是您在 Windows 上的 node.js 版本......也许它已损坏?尝试升级...

似乎它正在尝试重建您的本地 node-gyp 并且在 Windows 上找不到编译器来完成这项工作......但它与 sqlite-storage 包无关......

顺便说一句,react-native-sqlite 没有 Android 版本,并且仍处于早期开发阶段...@Kastriot Dreshaj

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-07
    • 1970-01-01
    • 1970-01-01
    • 2018-07-19
    • 2020-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多