I face the following error while trying to install serialport
library from NPM
$ npm i serialport
> @serialport/[email protected] install /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp
> node-gyp-build
make: Entering directory '/home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/build'
CXX(target) Release/obj.target/bindings/src/serialport.o
CXX(target) Release/obj.target/bindings/src/serialport_unix.o
CXX(target) Release/obj.target/bindings/src/poller.o
../src/poller.cpp: In static member function ‘static Napi::Object Poller::Init(Napi::Env, Napi::Object)’:
../src/poller.cpp:108:7: error: ‘class Napi::Env’ has no member named ‘SetInstanceData’
108 | env.SetInstanceData<Napi::FunctionReference>(constructor);
| ^~~~~~~~~~~~~~~
../src/poller.cpp:108:46: error: expected primary-expression before ‘>’ token
108 | env.SetInstanceData<Napi::FunctionReference>(constructor);
| ^
../src/poller.cpp: In static member function ‘static Napi::Value Poller::New(const Napi::CallbackInfo&)’:
../src/poller.cpp:127:53: error: ‘class Napi::Env’ has no member named ‘GetInstanceData’
127 | Napi::FunctionReference* constructor = info.Env().GetInstanceData<Napi::FunctionReference>();
| ^~~~~~~~~~~~~~~
../src/poller.cpp:127:92: error: expected primary-expression before ‘>’ token
127 | Napi::FunctionReference* constructor = info.Env().GetInstanceData<Napi::FunctionReference>();
| ^
../src/poller.cpp:127:94: error: expected primary-expression before ‘)’ token
127 | Napi::FunctionReference* constructor = info.Env().GetInstanceData<Napi::FunctionReference>();
| ^
make: *** [bindings.target.mk:106: Release/obj.target/bindings/src/poller.o] Error 1
make: Leaving directory '/home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/nodejs/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.15.0-71-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=14.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":"^12.22 || ^14.13 || >=16"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: @serialport/[email protected]
npm WARN enoent ENOENT: no such file or directory, open '/home/amin/Node/serial-port/package.json'
npm WARN serial-port No description
npm WARN serial-port No repository field.
npm WARN serial-port No README data
npm WARN serial-port No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/[email protected] install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/[email protected] 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! /home/amin/.npm/_logs/2023-05-03T13_57_21_065Z-debug.log
I tried with sudo
as well, but still couldn't been able to install the library.
Node version:
$ node -v
v10.19.0
Npm version
npm -v
6.14.4
OS release:
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Log from /home/amin/.npm/_logs/2023-05-03T13_57_21_065Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i', 'serialport' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session ade364f099509d44
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/serialport 206ms (from cache)
8 silly pacote tag manifest for serialport@latest fetched in 216ms
9 timing stage:loadCurrentTree Completed in 263ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 5ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule [email protected] checking installable status
17 http fetch GET 304 https://registry.npmjs.org/@serialport%2fbindings-cpp 485ms (from cache)
18 silly pacote version manifest for @serialport/[email protected] fetched in 491ms
19 silly resolveWithNewModule @serialport/[email protected] checking installable status
20 http fetch GET 304 https://registry.npmjs.org/node-gyp-build 313ms (from cache)
21 http fetch GET 304 https://registry.npmjs.org/node-addon-api 316ms (from cache)
22 silly pacote version manifest for [email protected] fetched in 318ms
23 silly resolveWithNewModule [email protected] checking installable status
24 silly pacote version manifest for [email protected] fetched in 321ms
25 silly resolveWithNewModule [email protected] checking installable status
26 http fetch GET 304 https://registry.npmjs.org/@serialport%2fparser-readline 600ms (from cache)
27 silly pacote version manifest for @serialport/[email protected] fetched in 603ms
28 silly resolveWithNewModule @serialport/[email protected] checking installable status
29 http fetch GET 304 https://registry.npmjs.org/@serialport%2fparser-delimiter 772ms (from cache)
30 silly pacote version manifest for @serialport/[email protected] fetched in 775ms
31 silly resolveWithNewModule @serialport/[email protected] checking installable status
32 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 1902ms
33 timing stage:loadIdealTree Completed in 1919ms
34 silly currentTree serial-port
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── @serialport/[email protected]
34 silly currentTree ├── [email protected]
34 silly currentTree └── [email protected]
35 silly idealTree serial-port
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├─┬ @serialport/[email protected]
35 silly idealTree │ ├── @serialport/[email protected]
35 silly idealTree │ └── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── @serialport/[email protected]
35 silly idealTree ├── [email protected]
35 silly idealTree ├── [email protected]
35 silly idealTree ├── [email protected]
35 silly idealTree ├── [email protected]
35 silly idealTree └── [email protected]
36 silly install generateActionsToTake
37 timing stage:generateActionsToTake Completed in 5ms
38 silly diffTrees action count 6
39 silly diffTrees add @serialport/[email protected]
40 silly diffTrees add @serialport/[email protected]
41 silly diffTrees add [email protected]
42 silly diffTrees add [email protected]
43 silly diffTrees add @serialport/[email protected]
44 silly diffTrees add [email protected]
45 silly decomposeActions action count 48
46 silly decomposeActions fetch @serialport/[email protected]
47 silly decomposeActions extract @serialport/[email protected]
48 silly decomposeActions preinstall @serialport/[email protected]
49 silly decomposeActions build @serialport/[email protected]
50 silly decomposeActions install @serialport/[email protected]
51 silly decomposeActions postinstall @serialport/[email protected]
52 silly decomposeActions finalize @serialport/[email protected]
53 silly decomposeActions refresh-package-json @serialport/[email protected]
54 silly decomposeActions fetch @serialport/[email protected]
55 silly decomposeActions extract @serialport/[email protected]
56 silly decomposeActions preinstall @serialport/[email protected]
57 silly decomposeActions build @serialport/[email protected]
58 silly decomposeActions install @serialport/[email protected]
59 silly decomposeActions postinstall @serialport/[email protected]
60 silly decomposeActions finalize @serialport/[email protected]
61 silly decomposeActions refresh-package-json @serialport/[email protected]
62 silly decomposeActions fetch [email protected]
63 silly decomposeActions extract [email protected]
64 silly decomposeActions preinstall [email protected]
65 silly decomposeActions build [email protected]
66 silly decomposeActions install [email protected]
67 silly decomposeActions postinstall [email protected]
68 silly decomposeActions finalize [email protected]
69 silly decomposeActions refresh-package-json [email protected]
70 silly decomposeActions fetch [email protected]
71 silly decomposeActions extract [email protected]
72 silly decomposeActions preinstall [email protected]
73 silly decomposeActions build [email protected]
74 silly decomposeActions install [email protected]
75 silly decomposeActions postinstall [email protected]
76 silly decomposeActions finalize [email protected]
77 silly decomposeActions refresh-package-json [email protected]
78 silly decomposeActions fetch @serialport/[email protected]
79 silly decomposeActions extract @serialport/[email protected]
80 silly decomposeActions preinstall @serialport/[email protected]
81 silly decomposeActions build @serialport/[email protected]
82 silly decomposeActions install @serialport/[email protected]
83 silly decomposeActions postinstall @serialport/[email protected]
84 silly decomposeActions finalize @serialport/[email protected]
85 silly decomposeActions refresh-package-json @serialport/[email protected]
86 silly decomposeActions fetch [email protected]
87 silly decomposeActions extract [email protected]
88 silly decomposeActions preinstall [email protected]
89 silly decomposeActions build [email protected]
90 silly decomposeActions install [email protected]
91 silly decomposeActions postinstall [email protected]
92 silly decomposeActions finalize [email protected]
93 silly decomposeActions refresh-package-json [email protected]
94 silly install executeActions
95 silly doSerial global-install 48
96 verbose correctMkdir /home/amin/.npm/_locks correctMkdir not in flight; initializing
97 verbose lock using /home/amin/.npm/_locks/staging-3420f01a03cc4215.lock for /home/amin/Node/serial-port/node_modules/.staging
98 silly doParallel extract 6
99 silly extract @serialport/[email protected]
100 silly extract @serialport/[email protected]
101 silly extract [email protected]
102 silly extract [email protected]
103 silly extract @serialport/[email protected]
104 silly extract [email protected]
105 silly tarball trying [email protected] by hash: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==
106 silly tarball trying [email protected] by hash: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==
107 silly tarball trying @serialport/[email protected] by hash: sha512-3I1mniVg3osYuIUXxU0jB5AHPsxWmErmc3JC3WfUSlfXsjWMHkHfFzbW9Scuv/z/6DLCJIDyltabRa2FoW2qsQ==
108 silly tarball trying serialport@latest by hash: sha512-bxs3XejQcOHWpzPAaXMhxVRlbem6fjNUrux3ToqrGvFR6BcjOYhqE5CsHOuutv37kmhmnuHrn+/hN+1BpTmaFg==
109 silly tarball trying @serialport/[email protected] by hash: sha512-/uR/yT3jmrcwnl2FJU/2ySvwgo5+XpksDUR4NF/nwTS5i3CcuKS+FKi/tLzy1k8F+rCx5JzpiK+koqPqOUWArA==
110 silly tarball trying @serialport/[email protected] by hash: sha512-0aXJknodcl94W9zSjvU+sLdXiyEG2rqjQmvBWZCr8wJZjWEtv3RgrnYiWq4i2OTOyC8C/oPK8ZjpBjQptRsoJQ==
111 silly extract [email protected] extracted to /home/amin/Node/serial-port/node_modules/.staging/node-gyp-build-04901aac (35ms)
112 silly extract @serialport/[email protected] extracted to /home/amin/Node/serial-port/node_modules/.staging/@serialport/parser-readline-2543d4b3 (36ms)
113 silly extract @serialport/[email protected] extracted to /home/amin/Node/serial-port/node_modules/.staging/@serialport/parser-delimiter-0cf7e480 (37ms)
114 silly extract serialport@latest extracted to /home/amin/Node/serial-port/node_modules/.staging/serialport-005f68ac (37ms)
115 silly extract [email protected] extracted to /home/amin/Node/serial-port/node_modules/.staging/node-addon-api-b1bfef42 (42ms)
116 silly extract @serialport/[email protected] extracted to /home/amin/Node/serial-port/node_modules/.staging/@serialport/bindings-cpp-99a3c038 (57ms)
117 timing action:extract Completed in 59ms
118 silly doReverseSerial unbuild 48
119 silly doSerial remove 48
120 silly doSerial move 48
121 silly doSerial finalize 48
122 silly finalize /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-delimiter
123 silly finalize /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-readline
124 silly finalize /home/amin/Node/serial-port/node_modules/node-addon-api
125 silly finalize /home/amin/Node/serial-port/node_modules/node-gyp-build
126 silly finalize /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp
127 silly finalize /home/amin/Node/serial-port/node_modules/serialport
128 timing action:finalize Completed in 6ms
129 silly doParallel refresh-package-json 6
130 silly refresh-package-json /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-delimiter
131 silly refresh-package-json /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-readline
132 silly refresh-package-json /home/amin/Node/serial-port/node_modules/node-addon-api
133 silly refresh-package-json /home/amin/Node/serial-port/node_modules/node-gyp-build
134 silly refresh-package-json /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp
135 silly refresh-package-json /home/amin/Node/serial-port/node_modules/serialport
136 timing action:refresh-package-json Completed in 13ms
137 silly doParallel preinstall 6
138 silly preinstall @serialport/[email protected]
139 info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
140 silly preinstall @serialport/[email protected]
141 info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
142 silly preinstall [email protected]
143 info lifecycle [email protected]~preinstall: [email protected]
144 silly preinstall [email protected]
145 info lifecycle [email protected]~preinstall: [email protected]
146 silly preinstall @serialport/[email protected]
147 info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
148 silly preinstall [email protected]
149 info lifecycle [email protected]~preinstall: [email protected]
150 timing action:preinstall Completed in 2ms
151 silly doSerial build 48
152 silly build @serialport/[email protected]
153 info linkStuff @serialport/[email protected]
154 silly linkStuff @serialport/[email protected] has /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules as its parent node_modules
155 silly build @serialport/[email protected]
156 info linkStuff @serialport/[email protected]
157 silly linkStuff @serialport/[email protected] has /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules as its parent node_modules
158 silly build [email protected]
159 info linkStuff [email protected]
160 silly linkStuff [email protected] has /home/amin/Node/serial-port/node_modules as its parent node_modules
161 silly build [email protected]
162 info linkStuff [email protected]
163 silly linkStuff [email protected] has /home/amin/Node/serial-port/node_modules as its parent node_modules
164 verbose linkBins [ { 'node-gyp-build': 'bin.js',
164 verbose linkBins 'node-gyp-build-optional': 'optional.js',
164 verbose linkBins 'node-gyp-build-test': 'build-test.js' },
164 verbose linkBins '/home/amin/Node/serial-port/node_modules/.bin',
164 verbose linkBins false ]
165 silly build @serialport/[email protected]
166 info linkStuff @serialport/[email protected]
167 silly linkStuff @serialport/[email protected] has /home/amin/Node/serial-port/node_modules as its parent node_modules
168 silly build [email protected]
169 info linkStuff [email protected]
170 silly linkStuff [email protected] has /home/amin/Node/serial-port/node_modules as its parent node_modules
171 timing action:build Completed in 3ms
172 silly doSerial global-link 48
173 silly doParallel update-linked 0
174 silly doSerial install 48
175 silly install @serialport/[email protected]
176 info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
177 silly install @serialport/[email protected]
178 info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
179 silly install [email protected]
180 info lifecycle [email protected]~install: [email protected]
181 silly install [email protected]
182 info lifecycle [email protected]~install: [email protected]
183 silly install @serialport/[email protected]
184 info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
185 verbose lifecycle @serialport/[email protected]~install: unsafe-perm in lifecycle true
186 verbose lifecycle @serialport/[email protected]~install: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp/node_modules/.bin:/home/amin/Node/serial-port/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/mssql-tools/bin:/opt/mssql-tools/bin:/opt/mssql-tools/bin:/opt/mssql-tools/bin
187 verbose lifecycle @serialport/[email protected]~install: CWD: /home/amin/Node/serial-port/node_modules/@serialport/bindings-cpp
188 silly lifecycle @serialport/[email protected]~install: Args: [ '-c', 'node-gyp-build' ]
189 timing audit submit Completed in 376ms
190 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 376ms
191 timing audit body Completed in 1ms
192 silly lifecycle @serialport/[email protected]~install: Returned: code: 1 signal: null
193 info lifecycle @serialport/[email protected]~install: Failed to exec install script
194 timing action:install Completed in 3980ms
195 verbose unlock done using /home/amin/.npm/_locks/staging-3420f01a03cc4215.lock for /home/amin/Node/serial-port/node_modules/.staging
196 timing stage:rollbackFailedOptional Completed in 17ms
197 timing stage:runTopLevelLifecycles Completed in 6293ms
198 silly saveTree serial-port
198 silly saveTree ├─┬ @serialport/[email protected]
198 silly saveTree │ ├── @serialport/[email protected]
198 silly saveTree │ └─┬ [email protected]
198 silly saveTree │ └── [email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── @serialport/[email protected]
198 silly saveTree ├── [email protected]
198 silly saveTree ├── [email protected]
198 silly saveTree └─┬ [email protected]
198 silly saveTree └─┬ @serialport/[email protected]
198 silly saveTree ├─┬ @serialport/[email protected]
198 silly saveTree │ └── @serialport/[email protected]
198 silly saveTree ├── [email protected]
198 silly saveTree └── [email protected]
199 warn notsup Unsupported engine for [email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
200 warn notsup Not compatible with your version of node/npm: [email protected]
201 verbose notsup Not compatible with your version of node/npm: [email protected]
201 verbose notsup Required: {"node":">=12.0.0"}
201 verbose notsup Actual: {"npm":"6.14.4","node":"10.19.0"}
202 warn notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=14.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
203 warn notsup Not compatible with your version of node/npm: @serialport/[email protected]
204 verbose notsup Not compatible with your version of node/npm: @serialport/[email protected]
204 verbose notsup Required: {"node":">=14.0.0"}
204 verbose notsup Actual: {"npm":"6.14.4","node":"10.19.0"}
205 warn notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
206 warn notsup Not compatible with your version of node/npm: @serialport/[email protected]
207 verbose notsup Not compatible with your version of node/npm: @serialport/[email protected]
207 verbose notsup Required: {"node":">=12.0.0"}
207 verbose notsup Actual: {"npm":"6.14.4","node":"10.19.0"}
208 warn notsup Unsupported engine for @serialport/[email protected]: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
209 warn notsup Not compatible with your version of node/npm: @serialport/[email protected]
210 verbose notsup Not compatible with your version of node/npm: @serialport/[email protected]
210 verbose notsup Required: {"node":">=12.0.0"}
210 verbose notsup Actual: {"npm":"6.14.4","node":"10.19.0"}
211 warn enoent ENOENT: no such file or directory, open '/home/amin/Node/serial-port/package.json'
212 verbose enoent This is related to npm not being able to find a file.
213 warn serial-port No description
214 warn serial-port No repository field.
215 warn serial-port No README data
216 warn serial-port No license field.
217 verbose stack Error: @serialport/[email protected] install: `node-gyp-build`
217 verbose stack Exit status 1
217 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
217 verbose stack at EventEmitter.emit (events.js:198:13)
217 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
217 verbose stack at ChildProcess.emit (events.js:198:13)
217 verbose stack at maybeClose (internal/child_process.js:982:16)
217 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
218 verbose pkgid @serialport/[email protected]
219 verbose cwd /home/amin/Node/serial-port
220 verbose Linux 5.15.0-71-generic
221 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "serialport"
222 verbose node v10.19.0
223 verbose npm v6.14.4
224 error code ELIFECYCLE
225 error errno 1
226 error @serialport/[email protected] install: `node-gyp-build`
226 error Exit status 1
227 error Failed at the @serialport/[email protected] install script.
227 error This is probably not a problem with npm. There is likely additional logging output above.
228 verbose exit [ 1, true ]
This looks like an issue with your node version. As the above message says:
wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
and your system has v10.19.0.
Try using nvm and installing the node version >= 12.0.0.
Here's the reference if you need it: https://github.com/nvm-sh/nvm