Mqtt.js: Error 'MODULE_NOT_FOUND'

Created on 26 May 2020  路  4Comments  路  Source: mqttjs/MQTT.js

I installed mqtt globally on windows 10, but when i type "mqtt -v" getting the following error:

internal/modules/cjs/loader.js:960
throw err;
^

Require stack:

  • C:\Users\DavidMG\AppData\Roamingnpmnode_modules\mqtt\bin\mqtt.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (C:\Users\DavidMG\AppData\Roamingnpmnode_
    9)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:
    /run_main.js:74:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\DavidMG\AppData\Roaming\npm\node_modules\mqtt\bin\mq
    tt.js'
    ]

When you moved mqtt.js to ./bin, the reference to ./bin/pub and ./bin/sub was lost...

Most helpful comment

All 4 comments

Same here on Mac, when I downgrade to 4.0.0 all works fine

How can I downgrade to 4.0.0.0 or install this specific release??

Thanks a lot!!

Was this page helpful?
0 / 5 - 0 ratings