I am trying to install lib MQTT v5 and it is not installing, returns a series of errors and aborts the installation.
My Environment is Windows 6, node 11.11.0 and npm 6.10.0.
Could someone clarify how I should proceed to be able to perform the installation?
Unable to Install MQTT.js V5
DaltonLuisBoer can you provide a little more details on the error output?
shal After a long delay, follow the output:
0 info it worked if it ends with ok
--dev
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'git+https://github.com/mqttjs/MQTT.js.git' ]
2 info using npm@6.10.0
3 info using node@v11.11.0
4 verbose npm-session 8a97d90c90cd8cbd
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose prepareGitDep undefined: installing devDeps and running prepare script.
8 error prepareGitDep 1>
8 error prepareGitDep > pre-commit@1.2.2 install C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\pre-commit
8 error prepareGitDep > node install.js
8 error prepareGitDep
8 error prepareGitDep
8 error prepareGitDep > spawn-sync@1.0.15 postinstall C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\spawn-sync
8 error prepareGitDep > node postinstall
8 error prepareGitDep
8 error prepareGitDep
8 error prepareGitDep > ngrok@2.1.8 postinstall C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\ngrok
8 error prepareGitDep > node ./postinstall.js
8 error prepareGitDep
8 error prepareGitDep ngrok - downloading binary https://bin.equinox.io/a/chRZWPptE7w/ngrok-2.1.1-windows-amd64.zip ...
8 error prepareGitDep ngrok - binary downloaded...
9 error prepareGitDep 2> npm WARN install Usage of theoption is deprecated. Use
--only=devinstead.
node ./postinstall.js
9 error prepareGitDep npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead:
9 error prepareGitDep npm WARN deprecated npm i nyc
9 error prepareGitDep npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
9 error prepareGitDep npm WARN deprecated formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
9 error prepareGitDep npm WARN deprecated samsam@1.1.2: This package has been deprecated in favour of @sinonjs/samsam
9 error prepareGitDep npm WARN deprecated superagent@0.15.7: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header). This notice will go away with v5.0.2+ once it is released.
9 error prepareGitDep npm WARN deprecated samsam@1.1.3: This package has been deprecated in favour of @sinonjs/samsam
9 error prepareGitDep npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated istanbul@0.2.16: This module is no longer maintained, try this instead:
9 error prepareGitDep npm WARN deprecated npm i nyc
9 error prepareGitDep npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
9 error prepareGitDep npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
9 error prepareGitDep npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
9 error prepareGitDep npm WARN deprecated connect@2.12.0: connect 2.x series is deprecated
9 error prepareGitDep npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
9 error prepareGitDep npm WARN deprecated forEachAsync@2.2.1: Please use 'foreachasync' instead. See https://www.npmjs.com/package/foreachasync
9 error prepareGitDep npm WARN deprecated hawk@1.1.1: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
9 error prepareGitDep npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
9 error prepareGitDep npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated boom@0.4.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated hoek@0.9.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated cryptiles@0.2.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated sntp@0.2.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
9 error prepareGitDep npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
9 error prepareGitDep ngrok - error unpacking binary Error: You cannot extract a file outside of the target path
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\lib\decompress-zip.js:95:21
9 error prepareGitDep at Array.map (<anonymous>)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\lib\decompress-zip.js:91:25
9 error prepareGitDep at _fulfilled (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\node_modules\q\q.js:854:54)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\node_modules\q\q.js:883:30
9 error prepareGitDep at Promise.promise.promiseDispatch (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\node_modules\q\q.js:816:13)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\node_modules\q\q.js:624:44
9 error prepareGitDep at runSingle (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\node_modules\q\q.js:137:13)
9 error prepareGitDep at flush (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-41c21da6\node_modules\decompress-zip\node_modules\q\q.js:125:13)
9 error prepareGitDep at processTicksAndRejections (internal/process/next_tick.js:74:9)
9 error prepareGitDep npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
9 error prepareGitDep npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
9 error prepareGitDep
9 error prepareGitDep npm ERR! code ELIFECYCLE
9 error prepareGitDep npm ERR! errno 1
9 error prepareGitDep npm ERR! ngrok@2.1.8 postinstall:9 error prepareGitDep npm ERR! Exit status 1
9 error prepareGitDep npm ERR!
9 error prepareGitDep npm ERR! Failed at the ngrok@2.1.8 postinstall script.
9 error prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
9 error prepareGitDep
9 error prepareGitDep npm ERR! A complete log of this run can be found in:
9 error prepareGitDep npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-09-03T15_37_48_409Z-debug.log
10 silly fetchPackageMetaData error for git+https://github.com/mqttjs/MQTT.js.git premature close
11 timing stage:rollbackFailedOptional Completed in 2ms
12 timing stage:runTopLevelLifecycles Completed in 443904ms
13 verbose stack Error: premature close
13 verbose stack at PassThrough.onclose (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\end-of-stream\index.js:47:67)
13 verbose stack at PassThrough.emit (events.js:202:15)
13 verbose stack at emitCloseNT (internal/streams/destroy.js:59:8)
13 verbose stack at processTicksAndRejections (internal/process/next_tick.js:76:17)
13 verbose stack From previous event:
13 verbose stack at tarballedProps (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:161:23)
13 verbose stack at cachedManifest.then.cached (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:49:14)
13 verbose stack From previous event:
13 verbose stack at finalizeManifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:45:25)
13 verbose stack at fetchManifest.then.rawManifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:25:14)
13 verbose stack From previous event:
13 verbose stack at pinflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:24:38)
13 verbose stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
13 verbose stack From previous event:
13 verbose stack at _inflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
13 verbose stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
13 verbose stack at processImmediate (timers.js:637:19)
13 verbose stack From previous event:
13 verbose stack at inflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:14:40)
13 verbose stack at Object.manifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:22:10)
13 verbose stack at fetchPackageMetadata (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\fetch-package-metadata.js:58:10)
13 verbose stack at limited (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\call-limit\call-limit.js:29:10)
13 verbose stack at fs.stat (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:237:20)
13 verbose stack at callback (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:289:20)
13 verbose stack at FSReqCallback.oncomplete (fs.js:158:21)
14 verbose cwd C:\prj_4engage\tstStomp
15 verbose Windows_NT 6.1.7601
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "git+https://github.com/mqttjs/MQTT.js.git"
17 verbose node v11.11.0
18 verbose npm v6.10.0
19 error premature close
20 verbose exit [ 1, true ]
Hi! Try to clean npm cache.
npm cache clean --force
dexif After long wait the installation is not done, follow the exit:
0 info it worked if it ends with ok
--dev
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'git+https://github.com/mqttjs/MQTT.js.git' ]
2 info using npm@6.10.0
3 info using node@v11.11.0
4 verbose npm-session 933adc01e3445741
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose prepareGitDep undefined: installing devDeps and running prepare script.
8 error prepareGitDep 1>
8 error prepareGitDep > pre-commit@1.2.2 install C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\pre-commit
8 error prepareGitDep > node install.js
8 error prepareGitDep
8 error prepareGitDep
8 error prepareGitDep > spawn-sync@1.0.15 postinstall C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\spawn-sync
8 error prepareGitDep > node postinstall
8 error prepareGitDep
8 error prepareGitDep
8 error prepareGitDep > ngrok@2.1.8 postinstall C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\ngrok
8 error prepareGitDep > node ./postinstall.js
8 error prepareGitDep
8 error prepareGitDep ngrok - downloading binary https://bin.equinox.io/a/chRZWPptE7w/ngrok-2.1.1-windows-amd64.zip ...
8 error prepareGitDep ngrok - binary downloaded...
9 error prepareGitDep 2> npm WARN install Usage of theoption is deprecated. Use
--only=devinstead.
node ./postinstall.js
9 error prepareGitDep npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead:
9 error prepareGitDep npm WARN deprecated npm i nyc
9 error prepareGitDep npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
9 error prepareGitDep npm WARN deprecated formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
9 error prepareGitDep npm WARN deprecated samsam@1.1.2: This package has been deprecated in favour of @sinonjs/samsam
9 error prepareGitDep npm WARN deprecated superagent@0.15.7: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header). This notice will go away with v5.0.2+ once it is released.
9 error prepareGitDep npm WARN deprecated samsam@1.1.3: This package has been deprecated in favour of @sinonjs/samsam
9 error prepareGitDep npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
9 error prepareGitDep npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated istanbul@0.2.16: This module is no longer maintained, try this instead:
9 error prepareGitDep npm WARN deprecated npm i nyc
9 error prepareGitDep npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
9 error prepareGitDep npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
9 error prepareGitDep npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
9 error prepareGitDep npm WARN deprecated connect@2.12.0: connect 2.x series is deprecated
9 error prepareGitDep npm WARN deprecated forEachAsync@2.2.1: Please use 'foreachasync' instead. See https://www.npmjs.com/package/foreachasync
9 error prepareGitDep npm WARN deprecated hawk@1.1.1: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
9 error prepareGitDep npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
9 error prepareGitDep npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated boom@0.4.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated hoek@0.9.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated cryptiles@0.2.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated sntp@0.2.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
9 error prepareGitDep npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
9 error prepareGitDep ngrok - error unpacking binary Error: You cannot extract a file outside of the target path
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\lib\decompress-zip.js:95:21
9 error prepareGitDep at Array.map (<anonymous>)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\lib\decompress-zip.js:91:25
9 error prepareGitDep at _fulfilled (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\node_modules\q\q.js:854:54)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\node_modules\q\q.js:883:30
9 error prepareGitDep at Promise.promise.promiseDispatch (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\node_modules\q\q.js:816:13)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\node_modules\q\q.js:624:44
9 error prepareGitDep at runSingle (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\node_modules\q\q.js:137:13)
9 error prepareGitDep at flush (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-85462e35\node_modules\decompress-zip\node_modules\q\q.js:125:13)
9 error prepareGitDep at processTicksAndRejections (internal/process/next_tick.js:74:9)
9 error prepareGitDep npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
9 error prepareGitDep npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
9 error prepareGitDep
9 error prepareGitDep npm ERR! code ELIFECYCLE
9 error prepareGitDep npm ERR! errno 1
9 error prepareGitDep npm ERR! ngrok@2.1.8 postinstall:9 error prepareGitDep npm ERR! Exit status 1
9 error prepareGitDep npm ERR!
9 error prepareGitDep npm ERR! Failed at the ngrok@2.1.8 postinstall script.
9 error prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
9 error prepareGitDep
9 error prepareGitDep npm ERR! A complete log of this run can be found in:
9 error prepareGitDep npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-09-03T16_20_58_141Z-debug.log
10 silly fetchPackageMetaData error for git+https://github.com/mqttjs/MQTT.js.git premature close
11 timing stage:rollbackFailedOptional Completed in 2ms
12 timing stage:runTopLevelLifecycles Completed in 366923ms
13 verbose stack Error: premature close
13 verbose stack at PassThrough.onclose (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\end-of-stream\index.js:47:67)
13 verbose stack at PassThrough.emit (events.js:202:15)
13 verbose stack at emitCloseNT (internal/streams/destroy.js:59:8)
13 verbose stack at processTicksAndRejections (internal/process/next_tick.js:76:17)
13 verbose stack From previous event:
13 verbose stack at tarballedProps (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:161:23)
13 verbose stack at cachedManifest.then.cached (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:49:14)
13 verbose stack From previous event:
13 verbose stack at finalizeManifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:45:25)
13 verbose stack at fetchManifest.then.rawManifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:25:14)
13 verbose stack From previous event:
13 verbose stack at pinflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:24:38)
13 verbose stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
13 verbose stack From previous event:
13 verbose stack at _inflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
13 verbose stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
13 verbose stack at processImmediate (timers.js:637:19)
13 verbose stack From previous event:
13 verbose stack at inflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:14:40)
13 verbose stack at Object.manifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:22:10)
13 verbose stack at fetchPackageMetadata (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\fetch-package-metadata.js:58:10)
13 verbose stack at limited (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\call-limit\call-limit.js:29:10)
13 verbose stack at fs.stat (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:237:20)
13 verbose stack at callback (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:289:20)
13 verbose stack at FSReqCallback.oncomplete (fs.js:158:21)
14 verbose cwd C:\prj_4engage\tstStomp
15 verbose Windows_NT 6.1.7601
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "git+https://github.com/mqttjs/MQTT.js.git"
17 verbose node v11.11.0
18 verbose npm v6.10.0
19 error premature close
20 verbose exit [ 1, true ]
Ok. Try to install zuul-ngrok from git before installing mqtt.js
npm i https://github.com/rase-/zuul-ngrok.git
dexif Again the installation is not done, follow the exit:
0 info it worked if it ends with ok
--dev
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'git+https://github.com/mqttjs/MQTT.js.git',
1 verbose cli '--save' ]
2 info using npm@6.10.0
3 info using node@v11.11.0
4 verbose npm-session 06febeeb2a636838
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose prepareGitDep undefined: installing devDeps and running prepare script.
8 error prepareGitDep 1>
8 error prepareGitDep > pre-commit@1.2.2 install C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\pre-commit
8 error prepareGitDep > node install.js
8 error prepareGitDep
8 error prepareGitDep
8 error prepareGitDep > spawn-sync@1.0.15 postinstall C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\spawn-sync
8 error prepareGitDep > node postinstall
8 error prepareGitDep
8 error prepareGitDep
8 error prepareGitDep > ngrok@2.1.8 postinstall C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\ngrok
8 error prepareGitDep > node ./postinstall.js
8 error prepareGitDep
8 error prepareGitDep ngrok - downloading binary https://bin.equinox.io/a/chRZWPptE7w/ngrok-2.1.1-windows-amd64.zip ...
8 error prepareGitDep ngrok - binary downloaded...
9 error prepareGitDep 2> npm WARN install Usage of theoption is deprecated. Use
--only=devinstead.
node ./postinstall.js
9 error prepareGitDep npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead:
9 error prepareGitDep npm WARN deprecated npm i nyc
9 error prepareGitDep npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
9 error prepareGitDep npm WARN deprecated formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
9 error prepareGitDep npm WARN deprecated samsam@1.1.2: This package has been deprecated in favour of @sinonjs/samsam
9 error prepareGitDep npm WARN deprecated superagent@0.15.7: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header). This notice will go away with v5.0.2+ once it is released.
9 error prepareGitDep npm WARN deprecated samsam@1.1.3: This package has been deprecated in favour of @sinonjs/samsam
9 error prepareGitDep npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
9 error prepareGitDep npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
9 error prepareGitDep npm WARN deprecated connect@2.12.0: connect 2.x series is deprecated
9 error prepareGitDep npm WARN deprecated istanbul@0.2.16: This module is no longer maintained, try this instead:
9 error prepareGitDep npm WARN deprecated npm i nyc
9 error prepareGitDep npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.
9 error prepareGitDep npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
9 error prepareGitDep npm WARN deprecated forEachAsync@2.2.1: Please use 'foreachasync' instead. See https://www.npmjs.com/package/foreachasync
9 error prepareGitDep npm WARN deprecated hawk@1.1.1: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
9 error prepareGitDep npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
9 error prepareGitDep npm WARN deprecated minimatch@0.4.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated hoek@0.9.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated boom@0.4.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated cryptiles@0.2.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
9 error prepareGitDep npm WARN deprecated sntp@0.2.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
9 error prepareGitDep npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
9 error prepareGitDep npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
9 error prepareGitDep ngrok - error unpacking binary Error: You cannot extract a file outside of the target path
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\lib\decompress-zip.js:95:21
9 error prepareGitDep at Array.map (<anonymous>)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\lib\decompress-zip.js:91:25
9 error prepareGitDep at _fulfilled (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\node_modules\q\q.js:854:54)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\node_modules\q\q.js:883:30
9 error prepareGitDep at Promise.promise.promiseDispatch (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\node_modules\q\q.js:816:13)
9 error prepareGitDep at C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\node_modules\q\q.js:624:44
9 error prepareGitDep at runSingle (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\node_modules\q\q.js:137:13)
9 error prepareGitDep at flush (C:\Users\HP\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-647b5eee\node_modules\decompress-zip\node_modules\q\q.js:125:13)
9 error prepareGitDep at processTicksAndRejections (internal/process/next_tick.js:74:9)
9 error prepareGitDep npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
9 error prepareGitDep npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
9 error prepareGitDep
9 error prepareGitDep npm ERR! code ELIFECYCLE
9 error prepareGitDep npm ERR! errno 1
9 error prepareGitDep npm ERR! ngrok@2.1.8 postinstall:9 error prepareGitDep npm ERR! Exit status 1
9 error prepareGitDep npm ERR!
9 error prepareGitDep npm ERR! Failed at the ngrok@2.1.8 postinstall script.
9 error prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
9 error prepareGitDep
9 error prepareGitDep npm ERR! A complete log of this run can be found in:
9 error prepareGitDep npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-09-03T16_43_04_805Z-debug.log
10 silly fetchPackageMetaData error for git+https://github.com/mqttjs/MQTT.js.git premature close
11 timing stage:rollbackFailedOptional Completed in 2ms
12 timing stage:runTopLevelLifecycles Completed in 384720ms
13 verbose stack Error: premature close
13 verbose stack at PassThrough.onclose (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\end-of-stream\index.js:47:67)
13 verbose stack at PassThrough.emit (events.js:202:15)
13 verbose stack at emitCloseNT (internal/streams/destroy.js:59:8)
13 verbose stack at processTicksAndRejections (internal/process/next_tick.js:76:17)
13 verbose stack From previous event:
13 verbose stack at tarballedProps (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:161:23)
13 verbose stack at cachedManifest.then.cached (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:49:14)
13 verbose stack From previous event:
13 verbose stack at finalizeManifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\finalize-manifest.js:45:25)
13 verbose stack at fetchManifest.then.rawManifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:25:14)
13 verbose stack From previous event:
13 verbose stack at pinflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:24:38)
13 verbose stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
13 verbose stack From previous event:
13 verbose stack at _inflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
13 verbose stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
13 verbose stack at processImmediate (timers.js:637:19)
13 verbose stack From previous event:
13 verbose stack at inflight (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\promise-inflight\inflight.js:14:40)
13 verbose stack at Object.manifest (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\manifest.js:22:10)
13 verbose stack at fetchPackageMetadata (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\fetch-package-metadata.js:58:10)
13 verbose stack at limited (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\call-limit\call-limit.js:29:10)
13 verbose stack at fs.stat (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\lib\install\deps.js:237:20)
13 verbose stack at callback (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:289:20)
13 verbose stack at FSReqCallback.oncomplete (fs.js:158:21)
14 verbose cwd C:\prj_4engage\tstmqtt
15 verbose Windows_NT 6.1.7601
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "git+https://github.com/mqttjs/MQTT.js.git" "--save"
17 verbose node v11.11.0
18 verbose npm v6.10.0
19 error premature close
20 verbose exit [ 1, true ]
MQTT.js depends on zuul-ngrok version 4.0.0 and it depends on ngrok 2.1.8 and it does not work on windows. And new version of zuul-ngrok with new version of ngrok which works in windows is not yet on npmjs.com
dexif Well, could you tell me if there is another lib for nodejs that supports the V5 MQTT protocol?
Because I specifically need the shared subscription functionality for the client load balance.
Thank you for your attention.
You can see that you are not alone with this problem... :'(
https://github.com/rase-/zuul-ngrok/issues/14
You can try to use yarn instead npm. Maybe this will help you:
https://github.com/sclausen/ngx-mqtt/issues/126#issuecomment-467395080
dexif
Even using yarn still gives error, see:
warning sequence@2.2.1: The engine "ender" appears to be invalid.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
[-/3] ⡀ waiting...
[2/3] ⢀ ngrok
error C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e54a7.p
repare\node_modules\ngrok: Command failed.
Exit code: 1
Command: node ./postinstall.js
Arguments:
Directory: C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e5
4a7.prepare\node_modules\ngrok
Output:
ngrok - downloading binary https://bin.equinox.io/a/chRZWPptE7w/ngrok-2.1.1-windows-amd64.zip ...
ngrok - binary downloaded...
ngrok - error unpacking binary Error: You cannot extract a file outside of the target path
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e54a7.
prepare\node_modules\decompress-zip\lib\decompress-zip.js:95:21
at Array.map (<anonymous>)
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e54a7.
prepare\node_modules\decompress-zip\lib\decompress-zip.js:91:25
at _fulfilled (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c591
2780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:854:54)
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e54a7.
prepare\node_modules\decompress-zip\node_modules\q\q.js:883:30
at Promise.promise.promiseDispatch (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe
100f8cf84c0d7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:816:13)
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e54a7.
prepare\node_modules\decompress-zip\node_modules\q\q.js:624:44
at runSingle (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912
780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:137:13)
at flush (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a
3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:125:13)
You should install latest ngrok first. And then install mqtt.js. (using yarn)
dexif
I tried all the recommendations, but to no avail, this is the error:
ation.
warning sequence@2.2.1: The engine "ender" appears to be invalid.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
[-/3] ? waiting...
[2/3] ? ngrok
error C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d7
b784c5912780a3e54a7.prepare\node_modules\ngrok: Command failed.
Exit code: 1
Command: node ./postinstall.js
Arguments:
Directory: C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf8
4c0d7b784c5912780a3e54a7.prepare\node_modules\ngrok
Output:
ngrok - downloading binary https://bin.equinox.io/a/chRZWPptE7w/ngrok-2.1.1-windows-amd64.zip ...
ngrok - binary downloaded...
ngrok - error unpacking binary Error: You cannot extract a file outside of the target path
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d
7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\lib\decompress-zip.js:95:21
at Array.map (<anonymous>)
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d
7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\lib\decompress-zip.js:91:25
at _fulfilled (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe
100f8cf84c0d7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:854:54)
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d
7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:883:30
at Promise.promise.promiseDispatch (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6a
f8485ce30bef.2a9b8fbe100f8cf84c0d7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\
q.js:816:13)
at C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8cf84c0d
7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:624:44
at runSingle (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe1
00f8cf84c0d7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:137:13)
at flush (C:\Users\HP\AppData\Local\Yarn\Cache\v4\.tmp\ab9777095691e4972c6af8485ce30bef.2a9b8fbe100f8
cf84c0d7b784c5912780a3e54a7.prepare\node_modules\decompress-zip\node_modules\q\q.js:125:13)
- Edited
- Best Answerset by dexif
How do you want to use mqtt.js?
This error occurs only if you download mqtt.js sources and install all dependencies.
But you don't need to download mqttjs sources for developing your own applications that use mqttjs.
You should init new node project and simply install mqttjs as a dependency.
npm init
npm i mqtt
Alternatively if you want to continue developing mqttjs library you should clone mqttjs repo
git clone https://github.com/mqttjs/MQTT.js.git
then you should update zuul-ngrok dependency
npm i git+https://git@github.com/rase-/zuul-ngrok.git
and then you can install all dependencies of mqttjs
npm i
I hope this helps you ;)
dexif
Hello,
Thanks for your help, it is now working in conjunction with broker EMQ X protocol 5, which allows us to use shared subscription, allowing our customers to load balance.
Greetings from Brazil
Thanks again.
DaltonLuisBoer
Glad to hear that! 😀 It is very cool!
Can you describe how you use load balancing in your case and what is your project? ;)
If this is not a secret of course.
dexif
Our project is focused on the educational area.
As we will have thousands of concurrent users, we will have to manage clients on the backend for automatic load management, using the shared subscription feature will make our work easier.