سلام
من میخوام توی برنامه ام که با react native مینویسم از دیتابیس realm استفاده کنم. بعد از اینکه پروژه رو create کردم، دستور yarn add realm رو اجرا میکنم اما پیغام خطا میده و نصب نمیشه. کسی میتونه کمکم کنه؟
این هم آدرس سایت realm:
https://realm.io/docs/javascript/latest/#getting-help
ببینید نصب کردن این ابزار فقط مرحله نصب با npm نیست باید یکسری قدم های دیگه ای رو هم انجام بدید
فک کنم از لینک زیر realm رو دریافت کردید
https://www.npmjs.com/package/realm
اگر دقت کنید این پکیجی هست که نیاز به عملیات Build شدن دارد وگرنه شناخته نمیشه و پیام not found رو نمایش میده اگر بخش Building Realm باید دستور
npm install --build-from-source=realm
رو اجرا کنید و قبلش هم اگر از ویندوز استفاده میکنید دستور
npm install -g --production windows-build-tools
رو باید اجرا کنید
yarn add v1.2.1
warning ..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "win32" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "babel-jest@22.2.2" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
[4/4] Building fresh packages...
[1/1] ⠠ realm: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64
[-/1] ⠠ waiting...
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
error E:\dev\Workspace\TestRealm\node_modules\realm: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: E:\dev\Workspace\TestRealm\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@8.7.0 | win32 | x64
node-pre-gyp info check checked for "E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64\realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/2.2.7/realm-v2.2.7-node-v57-win32-x64.tar.gz
node-pre-gyp http 403 https://static.realm.io/node-pre-gyp/2.2.7/realm-v2.2.7-node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(403): https://static.realm.io/node-pre-gyp/2.2.7/realm-v2.2.7-node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for realm@2.2.7 and node@8.7.0 (node-v57 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.2.7/realm-v2.2.7-node-v57-win32-x64.tar.gz
E:\dev\Workspace\TestRealm\node_modules\realm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\no
de-gyp\bin\node-gyp.js" clean ) else (node "" clean )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.7.0 | win32 | x64
gyp info ok
E:\dev\Workspace\TestRealm\node_modules\realm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\no
de-gyp\bin\node-gyp.js" configure --fallback-to-build --module=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64\realm.node --module_name=realm
--module_path=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64 ) else (node "" configure --fallback-to-build --module=E:\dev\Workspace\TestRea
lm\node_modules\realm\compiled\node-v57_win32_x64\realm.node --module_name=realm --module_path=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64
)
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.7.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 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-
to-build" "--module=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64\realm.node" "--module_name=realm" "--module_path=E:\dev\Workspac
e\TestRealm\node_modules\realm\compiled\node-v57_win32_x64"
gyp ERR! cwd E:\dev\Workspace\TestRealm\node_modules\realm
gyp ERR! node -v v8.7.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=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_wi
n32_x64\realm.node --module_name=realm --module_path=E:\dev\Workspace\TestRealm\node_modules\realm\compiled\node-v57_win32_x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (E:\dev\Workspace\TestRealm\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\dev\Workspace\TestRealm\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-
build"
node-pre-gyp ERR! cwd E:\dev\Workspace\TestRealm\node_modules\realm
node-pre-gyp ERR! node -v v8.7.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
شاید پاسخ شما همینجا باشد
سلام
با عرض تشکر ازحسن توجه شما، پیغام خطایی که میده اینه:
error E:devWorkspaceTestRealm ode_modules ealm: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build
ممنون.
یه جا توی مستنداتش دیدم که باید NDK رو نصب کنم و ANDROID_NDK رو تنظیم کنم.
من از آدرس زیر استفاده کردم:
سلام
روشهای بالا رو امتحان کردم ولی متأسفانه هیچکدوم کار نکرد.
سلام
من بعد از تلاش و تحقیق به این نتیجه رسیدم که مشکل از VPNی که استفاده میکنم هست.
کسی آدرس *** خوب سراغ داره؟