Unable to npm install realm for react native

This is the log file for the failed installation

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '--save',
1 verbose cli   'realm'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.16.3
4 verbose npm-session ac314580881bb0e6
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/realm 1272ms (from cache)
8 silly pacote tag manifest for realm@latest fetched in 1339ms
9 timing stage:loadCurrentTree Completed in 1375ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule realm@5.0.4 checking installable status
17 silly fetchPackageMetaData error for node-addon-api@git+https://github.com/blagoev/node-addon-api.git#rjs Error while executing:
17 silly fetchPackageMetaData undefined ls-remote -h -t https://github.com/blagoev/node-addon-api.git
17 silly fetchPackageMetaData
17 silly fetchPackageMetaData
17 silly fetchPackageMetaData spawn git ENOENT
18 silly fetchPackageMetaData error for node-pre-gyp@git+https://github.com/kneth/node-pre-gyp.git#add-node-14.0.0 Error while executing:
18 silly fetchPackageMetaData undefined ls-remote -h -t https://github.com/kneth/node-pre-gyp.git
18 silly fetchPackageMetaData
18 silly fetchPackageMetaData
18 silly fetchPackageMetaData spawn git ENOENT
19 http fetch GET 304 https://registry.npmjs.org/ini 170ms (from cache)
20 silly pacote range manifest for ini@^1.3.5 fetched in 174ms
21 silly resolveWithNewModule ini@1.3.5 checking installable status
22 http fetch GET 304 https://registry.npmjs.org/request 159ms (from cache)
23 http fetch GET 304 https://registry.npmjs.org/node-fetch 296ms (from cache)
24 http fetch GET 304 https://registry.npmjs.org/prop-types 287ms (from cache)
25 http fetch GET 304 https://registry.npmjs.org/command-line-args 361ms (from cache)
26 http fetch GET 304 https://registry.npmjs.org/deprecated-react-native-listview 359ms (from cache)
27 http fetch GET 304 https://registry.npmjs.org/deepmerge 361ms (from cache)
28 http fetch GET 304 https://registry.npmjs.org/progress 293ms (from cache)
29 http fetch GET 304 https://registry.npmjs.org/https-proxy-agent 357ms (from cache)
30 silly pacote range manifest for node-fetch@^1.7.3 fetched in 306ms
31 silly resolveWithNewModule node-fetch@1.7.3 checking installable status
32 silly pacote range manifest for command-line-args@^4.0.6 fetched in 376ms
33 silly resolveWithNewModule command-line-args@4.0.7 checking installable status
34 silly pacote range manifest for request@^2.88.0 fetched in 197ms
35 warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
36 silly resolveWithNewModule request@2.88.2 checking installable status
37 silly pacote range manifest for prop-types@^15.6.2 fetched in 325ms
38 silly resolveWithNewModule prop-types@15.7.2 checking installable status
39 silly pacote range manifest for https-proxy-agent@^2.2.4 fetched in 390ms
40 silly resolveWithNewModule https-proxy-agent@2.2.4 checking installable status
41 silly pacote range manifest for progress@^2.0.3 fetched in 329ms
42 silly resolveWithNewModule progress@2.0.3 checking installable status
43 silly pacote version manifest for deprecated-react-native-listview@0.0.6 fetched in 397ms
44 silly resolveWithNewModule deprecated-react-native-listview@0.0.6 checking installable status
45 http fetch GET 304 https://registry.npmjs.org/fs-extra 396ms (from cache)
46 silly pacote range manifest for fs-extra@^4.0.3 fetched in 405ms
47 silly resolveWithNewModule fs-extra@4.0.3 checking installable status
48 silly pacote version manifest for deepmerge@2.1.0 fetched in 421ms
49 silly resolveWithNewModule deepmerge@2.1.0 checking installable status
50 http fetch GET 304 https://registry.npmjs.org/tar 131ms (from cache)
51 http fetch GET 304 https://registry.npmjs.org/url-parse 129ms (from cache)
52 http fetch GET 304 https://registry.npmjs.org/sync-request 165ms (from cache)
53 silly pacote range manifest for sync-request@^3.0.1 fetched in 169ms
54 silly resolveWithNewModule sync-request@3.0.1 checking installable status
55 http fetch GET 304 https://registry.npmjs.org/stream-counter 175ms (from cache)
56 silly pacote range manifest for url-parse@^1.4.4 fetched in 158ms
57 silly resolveWithNewModule url-parse@1.4.7 checking installable status
58 silly pacote range manifest for tar@^6.0.1 fetched in 174ms
59 silly resolveWithNewModule tar@6.0.2 checking installable status
60 silly pacote range manifest for stream-counter@^1.0.0 fetched in 214ms
61 silly resolveWithNewModule stream-counter@1.0.0 checking installable status
62 http fetch GET 304 https://registry.npmjs.org/node-machine-id 1042ms (from cache)
63 silly pacote range manifest for node-machine-id@^1.1.10 fetched in 1053ms
64 silly resolveWithNewModule node-machine-id@1.1.12 checking installable status
65 timing stage:rollbackFailedOptional Completed in 1ms
66 timing stage:runTopLevelLifecycles Completed in 2529ms
67 silly saveTree testnode@1.0.0
67 silly saveTree `-- realm@5.0.4
67 silly saveTree   +-- command-line-args@4.0.7
67 silly saveTree   +-- deepmerge@2.1.0
67 silly saveTree   +-- deprecated-react-native-listview@0.0.6
67 silly saveTree   +-- fs-extra@4.0.3
67 silly saveTree   +-- https-proxy-agent@2.2.4
67 silly saveTree   +-- ini@1.3.5
67 silly saveTree   +-- node-fetch@1.7.3
67 silly saveTree   +-- node-machine-id@1.1.12
67 silly saveTree   +-- progress@2.0.3
67 silly saveTree   +-- prop-types@15.7.2
67 silly saveTree   +-- request@2.88.2
67 silly saveTree   +-- stream-counter@1.0.0
67 silly saveTree   +-- sync-request@3.0.1
67 silly saveTree   +-- tar@6.0.2
67 silly saveTree   `-- url-parse@1.4.7
68 verbose stack Error: spawn git ENOENT
68 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
68 verbose stack     at onErrorNT (internal/child_process.js:469:16)
68 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
69 verbose cwd C:\Users\HP\Downloads\testNode
70 verbose Windows_NT 10.0.18363
71 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "realm"
72 verbose node v12.16.3
73 verbose npm  v6.14.4
74 error code ENOENT
75 error syscall spawn git
76 error path git
77 error errno ENOENT
78 error enoent Error while executing:
78 error enoent undefined ls-remote -h -t https://github.com/blagoev/node-addon-api.git
78 error enoent
78 error enoent
78 error enoent spawn git ENOENT
79 error enoent This is related to npm not being able to find a file.
80 verbose exit [ 1, true ]

@vivekananda_kalidind I don’t believe we support node 12

Welcome to the community @vivekananda_kalidind,

The error message indicates you need to have git installed in order to fetch the node-addon-api installation dependency:

74 error code ENOENT
75 error syscall spawn git
76 error path git
77 error errno ENOENT
78 error enoent Error while executing:
78 error enoent undefined ls-remote -h -t https://github.com/blagoev/node-addon-api.git
78 error enoent
78 error enoent
78 error enoent spawn git ENOENT
79 error enoent This is related to npm not being able to find a file.

The node-addon-api package is part of support for modern versions of Node via N-API, but I don’t see any callout for the git prerequisite in the installation instructions. I’ll follow-up with a GitHub issue for this if there isn’t one already.

Realm React Native currently supports Node 10 or higher.

Regards,
Stennie