آموزش جاوااسکریپت › انجمن ها › react native › realm database
- این موضوع 18 پاسخ، 6 کاربر را دارد و آخرین بار در 5 سال، 2 ماه پیش بدست zahra بهروزرسانی شده است.
-
نویسندهنوشتهها
-
zahraمشارکت کننده
سلام دوستان من به تازگی با realm اشنا شدم
کسی تا حالا کار کرده ؟ یکم اطلاعات راجبش می خواستم
و اموزش خوبی سراغ دارین در این زمینه ؟زبانش مهم نیست
ممنون میشم راهنماییم کنیدمهدیمیهمانسلام،
آموزش realm رو بصورت آموزش متنی قرار دادیم و در اولین بخش نحوه نصب این پایگاه داده رو بیان کردیم و در بخش های بعدی نحوه خوندن اطلاعات،حذف،ویرایش و درج نیز بیان خواهد شدzahraمشارکت کنندهبله دیدم اتفاقا با سایت شما باهاش اشنا شدم ولی اطلاعات کمی گفته بودین برای همین این تاپیک گذاشتم اگه میشه زودتر قسمت بعدی این دیتابیس را بزارید
مهدی حسن زادهمدیرکلدر طول هفته آینده کلیه آموزش های مربوط به realm قرار داده میشه
علیرضامدیرکلقسمت دوم هم منتشر شد
https://bit.ly/2JR5tFdhamidreza abasiمشارکت کنندهبا عرض سلام و خسته نباشید خدمت شما من موقع نصب پکیج Relam به خطای زیر برخورد می کنم از فیلتر شکنم استفاده می کنم
npm WARN eslint-plugin-react-native@3.2.1 requires a peer of eslint@^3.17.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename ‘C:\Users\HamidReza\Desktop\test\node_modules\.staging\fsevents-1d059d22\node_modules\concat-map’ -> ‘C:\Users\HamidReza\Desktop\test\node_modules\.staging\concat-map-10d4c5c2’npm ERR! path C:\Users\HamidReza\Desktop\test\node_modules\bl
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename ‘C:\Users\HamidReza\Desktop\test\node_modules\bl’ -> ‘C:\Users\HamidReza\Desktop\test\node_modules\.bl.DELETE’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HamidReza\AppData\Roaming\npm-cache\_logs\2018-06-18T09_05_08_392Z-debug.logمهدی حسن زادهمدیرکلسلام.
همونطور که در error به شما اعلام کرده،شما به eslint نیاز دارید که با دستور زیر میتونیدنصبش کنید
npm install eslint –save-dev
البته باید Node.js (>=4.x), npm version 2 باشهhamidreza abasiمشارکت کنندهسلام
این مشکل از کجاست؟
1 error
:realm:compileReleaseJavaWithJavac FAILEDمهدی حسن زادهمدیرکلبه احتمال زیاد دستور react-native link realm به درستی کار نکرده.بهتره عملیات لینک کتابخانه به پروژه رو بصورت دستی انجام بدید.
Seyed Mohammad Ali Rohbaniمشارکت کنندهسلام! منظور از تنظیم دستی چیه؟چجوری انجام میشه؟
منظور فقط اضافه کردن نگ به فایل package.jason ه؟مهدی حسن زادهمدیرکلسلام باید مراحل زیر رو طی کنید
Add the following lines to android/settings.gradle:include ‘:realm’
project(‘:realm’).projectDir = new File(rootProject.projectDir, ‘../node_modules/realm/android’)Add the compile line to the dependencies in android/app/build.gradle:
dependencies {
compile project(‘:realm’)
}Add the import and link the package in MainApplication.java:
import io.realm.react.RealmReactPackage; // add this import
public class MainApplication extends Application implements ReactApplication {
@Override
protected ListgetPackages() {
return Arrays.asList(
new MainReactPackage(),
new RealmReactPackage() // add this line
);
}
}
میتونید به لینک زیر مراجعه کنید و نحوه نصب دستی realm رو از روی داکیوکنت پیش برید
نصب realm در React NativeSeyed Mohammad Ali Rohbaniمشارکت کنندهPS G:\Programing\ReactNative\Project\ww\ww> npm install –save realm
> realm@2.13.0 install G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
> node-pre-gyp install –fallback-to-buildnode-pre-gyp ERR! Tried to download(403): https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for realm@2.13.0 and node@10.6.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for realm@2.13.0 and node@10.6.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
Traceback (most recent call last):
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py”, line 16, in <module>
sys.exit(gyp.script_main())
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py”, line 545, in script_main
return main(sys.argv[1:])
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py”, line 538, in main
Warning: Missing input files:
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\scripts\set-version.sh
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\scripts\changelog-header.sh
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\scripts\publish.sh
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\src\object-store\src\descriptor_ordering.hpp
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\src\object-store\src\util\compiler.hpp
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\lib\browser\util.jsscripts\build-node-pre-gyp.ps1
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\build\..\scripts\test.sh
return gyp_main(args)
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py”, line 523, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py”, line 2025, in GenerateOutput
version=msvs_version)
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py”, line 213, in __init__
self.Write()
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py”, line 340, in Write
f.close()
File “G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py”, line 393, in close
os.rename(self.tmp_path, filename)
WindowsError: [Error 183] Cannot create a file when that file already exists
gyp ERR! configure error
gyp ERR! stack Error:gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command “G:\\Programing\\ReactNative\\node\\node.exe” “G:\\Programing\\ReactNative\\node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js” “configure” “–fallback-to-build” “–module=G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\realm\\compiled\\node-v64_win32_x64\\realm.node” “–module_name=realm” “–module_path=G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\realm\\compiled\\node-v64_win32_x64” “–python=C:\\Users\\SMARTen\\.windows-build-tools\\python27\\python.exe” “–msvs_version=2015”
gyp ERR! cwd G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘G:\Programing\ReactNative\node\node.exe G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64 –python=C:\Users\SMARTen\.windows-build-tools\python27\python.exe –msvs_version=2015’ (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (G:\Programing\ReactNative\Project\ww\ww\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command “G:\\Programing\\ReactNative\\node\\node.exe” “G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
node-pre-gyp ERR! node -v v10.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute ‘G:\Programing\ReactNative\node\node.exe G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64 –python=C:\Users\SMARTen\.windows-build-tools\python27\python.exe –msvs_version=2015’ (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”win32″,”arch”:”x64″})npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! realm@2.13.0 install:node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the realm@2.13.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SMARTen\AppData\Roaming\npm-cache\_logs\2018-07-18T10_02_28_326Z-debug.logسلام من با اینا چکار کنم؟ 😐
لطفا راهنماییم کنید!
فیلترشکنمم وصله!مهدی حسن زادهمدیرکلسلام.میتونید با yarn نصبش کنید
1.Npm install -g yarn
2.Yarn add realmSeyed Mohammad Ali Rohbaniمشارکت کنندهواقعا از اینکه می خونید و جواب می دید ممنونم!
با یارن هم ارور داد!کلا هر پکیج جدید می خوام وارد کنم ارور میده!
ویندوزم 10 64 بیتی!
فیلتر شکنم فری گیته!
نسخه های noode , yarn , npm هم که این زیر گزفتم!
PS G:\Programing\ReactNative\Project\ww\ww> node -v
v10.6.0
PS G:\Programing\ReactNative\Project\ww\ww> yarn -v
1.7.0
PS G:\Programing\ReactNative\Project\ww\ww> npm -v
6.1.0
PS G:\Programing\ReactNative\Project\ww\ww> yarn add realm
yarn add v1.7.0
[1/4] Resolving packages…
⠂ realm(node:11260) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2/4] Fetching packages…
info fsevents@1.2.4: The platform “win32” is incompatible with this module.
info “fsevents@1.2.4” is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies…
warning “react-native > metro-babel-register > @babel/plugin-proposal-optional-chaining@7.0.0-beta.47” has unmet peer dependency “@babel/core@7.0.0-beta.47”.
warning “react-native > metro-babel-register > @babel/plugin-proposal-optional-chaining > @babel/plugin-syntax-optional-chaining@7.0.0-beta.47” has unmet peer dependency “@babel/core@7.0.0-beta.47″.
warning ” > babel-jest@23.4.0″ has unmet peer dependency “babel-core@^6.0.0 || ^7.0.0-0”.
[4/4] Building fresh packages…
error G:\Programing\ReactNative\Project\ww\ww\node_modules\realm: Command failed.
Exit code: 1
Command: node-pre-gyp install –fallback-to-build
Arguments:
Directory: G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@10.6.0 | win32 | x64
node-pre-gyp info check checked for “G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node” (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gz
node-pre-gyp http 403 https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(403): https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for realm@2.13.0 and node@10.6.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gzG:\Programing\ReactNative\Project\ww\ww\node_modules\realm>if not defined npm_config_node_gyp (node “G:\Programing\ReactNative\node\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js” clean ) else (node “” clean )
node-pre-gyp ERR! Tried to download(undefined): https://static.realm.io/node-pre-gyp/2.13.0/realm-v2.13.0-node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for realm@2.13.0 and node@10.6.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball fileG:\Programing\ReactNative\Project\ww\ww\node_modules\realm>if not defined npm_config_node_gyp (node “G:\Programing\ReactNative\node\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js” clean ) else (node “” clean )
gyp info it worked if it ends with ok
gypgyp info using node-gyp@3.6.2
gyp info using node@10.6.0 | win32 | x64
info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.6.0 | win32 | x64
gyp info ok
gyp info okG:\Programing\ReactNative\Project\ww\ww\node_modules\realm>if not defined npm_config_node_gyp (node “G:\Programing\ReactNative\node\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js” configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64 ) else (node “” configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64 )
G:\Programing\ReactNative\Project\ww\ww\node_modules\realm>if not defined npm_config_node_gyp (node “G:\Programing\ReactNative\node\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js” configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64 ) else (node “” configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64 )
gypgyp info it worked if it ends with ok
info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.6.0 | win32 | x64
gyp info using node-gyp@3.6.2
gyp info using node@10.6.0 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable “python”, you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at G:\Programing\ReactNative\node\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command “G:\\Programing\\ReactNative\\node\\node.exe” “G:\\Programing\\ReactNative\\node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js” “configure” “–fallback-to-build” “–module=G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\realm\\compiled\\node-v64_win32_x64\\realm.node” “–module_name=realm” “–module_path=G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\realm\\compiled\\node-v64_win32_x64”
gyp ERR! cwd G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -vgyp v3.6.2
ERR!gyp configure errorERR!
not ok
gyp ERR! stack Error: Can’t find Python executable “python”, you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (G:\Programing\ReactNative\node\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at G:\Programing\ReactNative\node\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command “G:\\Programing\\ReactNative\\node\\node.exe” “G:\\Programing\\ReactNative\\node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js” “configure” “–fallback-to-build” “–module=G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\realm\\compiled\\node-v64_win32_x64\\realm.node” “–module_name=realm” “–module_path=G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\realm\\compiled\\node-v64_win32_x64”
gyp ERR! cwd G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘node-gyp.cmd configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64’ (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (G:\Programing\ReactNative\Project\ww\ww\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command “G:\\Programing\\ReactNative\\node\\node.exe” “G:\\Programing\\ReactNative\\Project\\ww\\ww\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd G:\Programing\ReactNative\Project\ww\ww\node_modules\realm
node-pre-gyp ERR! node -v v10.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute ‘node-gyp.cmd configure –fallback-to-build –module=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64\realm.node –module_name=realm –module_path=G:\Programing\ReactNative\Project\ww\ww\node_modules\realm\compiled\node-v64_win32_x64’ (1)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
PS G:\Programing\ReactNative\Project\ww\ww>zahraمشارکت کنندهسلام دوستان من می خواستم الان استفاده کنم از این کتابخونه که این جمله را تو سایت خوندم
البته توجه کنید که ما از سمت Realm تحریم هستیم و باید از VPN قبل از اجرای دستور استفاده کنید):
ایا فقط برای اضافه کردن نیاز به وی پی ان داریم یا کاربر باید از وی پی ان استفاده کنه؟ -
نویسندهنوشتهها