Nerixyz / instagram_mqtt

Realtime and Push Notification (FBNS) support for the instagram-private-api
MIT License
244 stars 49 forks source link

Error when running npm i instagram_mqtt #92

Closed lucassilvas1 closed 2 years ago

lucassilvas1 commented 2 years ago

I'm getting this error when I try to install the module, can you help me?


npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated url-regex-safe@1.1.0: Please upgrade to url-regex-safe@v3.0.0+ AND install re2 as an additional dependency in your project via `npm install re2` or `yarn add re2`.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32
npm ERR! code 1
npm ERR! path C:\Users\Lucas\Javascript\notification-tests\node_modules\re2
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-93.br ...
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-93.gz ...
npm ERR! Building locally ...
npm ERR!
npm ERR! > re2@1.15.4 rebuild
npm ERR! > node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.13.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.0 found at "C:\Users\Lucas\AppData\Local\Programs\Python\Python38\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\notification-tests\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lucas\\Javascript\\notification-tests\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Lucas\Javascript\notification-tests\node_modules\re2
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node:internal/process/promises:246
npm ERR!           triggerUncaughtException(err, true /* fromPromise */);
npm ERR!           ^
npm ERR!
npm ERR! [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
npm ERR!   code: 'ERR_UNHANDLED_REJECTION'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lucas\AppData\Local\npm-cache\_logs\2022-02-06T22_31_46_717Z-debug.log```
algorithm117 commented 2 years ago

This post may help to resolve your issue. Particularly initram's answer which might require some additional time or DeuxAlpha's answer which might solve your problem more quickly. I haven't tried to reproduce your issue or anything like that, but I hope the link helps in resolving your problem!

lucassilvas1 commented 2 years ago

DeuxAlpha's answer didn't help and I don't really understand what's happening in the log so Initram's answer doesn't help me either. Do I need to have Visual Studio installed in order for this module to work for whatever reason? Because that's what I got from the log. I only use VS Code. Thanks

algorithm117 commented 2 years ago

Okay, so I ran the npm i instagram_mqtt command in a folder that is NPM managed inside of my VS Code and I did not get any errors. So, just want to make sure are you running the npm i instagram_mqtt in a npm managed folder? That is, have you ran npm install command first? Otherwise if you are starting from a fresh project have you ran npm init command first? Next thing is which version of VS Code are you running? My version is 1.64.0.

lucassilvas1 commented 2 years ago

I am on version 1.64.0 as well. The project I'm running doesn't have any dependencies yet, I only ran npm init and tried installing this module and it gives me that error every time.

algorithm117 commented 2 years ago

That is very strange. I created a completely new folder, ran npm init, and then npm i instagram_mqtt and I got no errors. Could you try this as well? Make sure you are in the correct folder when running the commands as well.

lucassilvas1 commented 2 years ago

I have done that already but I'll do it again just to be sure, hold on 1 sec.

lucassilvas1 commented 2 years ago

Nope, still get exactly the same error.

algorithm117 commented 2 years ago

Okay, this is quite an issue. Do you receive this error when trying to install any other dependencies for example nodemon? Or is it just for instagram_mqtt dependency?

lucassilvas1 commented 2 years ago

No, just tried installing nodemon and it went just fine.

PS C:\Users\Lucas\Javascript\plswork> npm i nodemon

added 116 packages, and audited 117 packages in 14s

16 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS C:\Users\Lucas\Javascript\plswork> 
algorithm117 commented 2 years ago

Okay, let's try two things. 1) Make sure to run these commands from inside of the VS Code integrated terminal. 2) Try running these commands as well which is taken from the issue I linked in my first response: npm install node-gyp -> npm audit fix -> npm install node-phpass.

algorithm117 commented 2 years ago

Also try running this command as well -> npm config set msvs_version 2017

lucassilvas1 commented 2 years ago

Getting this when I try to run npm install node-phpass (the previous commands worked fine):

PS C:\Users\Lucas\Javascript\plswork> npm install node-phpass
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm ERR! code 1
npm ERR! path C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0
npm ERR! node-pre-gyp info using node@16.13.0 | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.13.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.3.0
npm ERR! gyp info using node@16.13.0 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.3.0
npm ERR! gyp info using node@16.13.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.0 found at "C:\Users\Lucas\AppData\Local\Programs\Python\Python38\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lucas\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Lucas\\Javascript\\plswork\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\Lucas\\Javascript\\plswork\\node_modules\\bcrypt\\lib\\binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Lucas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Lucas\Javascript\plswork\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19044
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lucas\\Javascript\\plswork\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\Lucas\Javascript\plswork\node_modules\bcrypt
npm ERR! node-pre-gyp ERR! node -v v16.13.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lucas\AppData\Local\npm-cache\_logs\2022-02-07T00_17_27_702Z-debug.log
lucassilvas1 commented 2 years ago

Also, tried running npm config set msvs_version 2017 and then npm install node-phpass, same thing.

algorithm117 commented 2 years ago

Okay thank you for trying it out. Maybe we don't need to run the npm install node-phpass then. If the other commands worked fine that's good. Can you try seeing if the npm i instagram_mqtt works now?

lucassilvas1 commented 2 years ago

No luck, still getting the same error as before:

PS C:\Users\Lucas\Javascript\plswork> npm i instagram_mqtt
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated url-regex-safe@1.1.0: Please upgrade to url-regex-safe@v3.0.0+ AND install re2 as an additional dependency in your project via `npm install re2` or `yarn add re2`.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32
npm ERR! code 1
npm ERR! path C:\Users\Lucas\Javascript\plswork\node_modules\re2
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-93.br ...
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-93.gz ...
npm ERR! Building locally ...
npm ERR!
npm ERR! > re2@1.15.4 rebuild
npm ERR! > node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.13.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.0 found at "C:\Users\Lucas\AppData\Local\Programs\Python\Python38\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2017
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lucas\\Javascript\\plswork\\node_modules\\re2\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Lucas\Javascript\plswork\node_modules\re2
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node:internal/process/promises:246
npm ERR!           triggerUncaughtException(err, true /* fromPromise */);
npm ERR!           ^
npm ERR!
npm ERR! [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
npm ERR!   code: 'ERR_UNHANDLED_REJECTION'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lucas\AppData\Local\npm-cache\_logs\2022-02-07T00_23_02_099Z-debug.log

Do you have Visual Studio installed on your PC, maybe I need to install it for some reason, idk.

algorithm117 commented 2 years ago

I have VS Code installed on my PC. Also I'm running it on a Linux distribution. The issue could be using Windows but I'm not sure on that. The other dependencies are working well enough for you, I'm not sure exactly why the issue pops up with this particular dependency. Maybe trying a fresh install of VS Code might be the way to go.

algorithm117 commented 2 years ago

Also just to make sure one more time, are you using the Window's terminal to execute the commands or VS Code integrated terminal?

lucassilvas1 commented 2 years ago

the VS Code one, I'll try it from outside VS now.

lucassilvas1 commented 2 years ago

yeah, same thing outside VS Code too.

algorithm117 commented 2 years ago

Okay, I've just read something on StackOverflow that might help. 1) Try running npm update command. 2) npm config get python should be set to something that is version 3.x or above. 3) npm config get msvs_version should be using version 2022: npm config set msvs_version 2022 --global 4) An Environment variable named VCINSTALLDIR should be set to C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\ 5) Try to set Python on correctly on the path: npm config set python /path/to/executable/python and then run npm install command.

I hope one of these things work out for you.

lucassilvas1 commented 2 years ago

Okay, I'm on step 3 right now, should I really do that? I don't have VS installed so that directory doesn't even exist

lucassilvas1 commented 2 years ago

Okay, I'm on step 3 right now, should I really do that? I don't have VS installed so that directory doesn't even exist

I'm sorry, I mean step 4.

algorithm117 commented 2 years ago

That's okay, don't do step 4 then. Try step 5 and see if it works out. Otherwise I think moving forward it would be a good idea to install Visual Studio.

lucassilvas1 commented 2 years ago

Stepts 1, 2, 3 and 5 didn't help, I'll try installing VS 2022 and see if that helps

algorithm117 commented 2 years ago

Okay! Thank you for taking the time to try those steps out. Let's see if installing VS 2022 helps the issue out.

lucassilvas1 commented 2 years ago

Yeah, installed VS 2022 along with the "Desktop development with C++" workload that the log suggested, and tried step 4, still get the same error when trying to install the module:

PS C:\Users\Lucas\Javascript\plswork> npm i instagram_mqtt
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated url-regex-safe@1.1.0: Please upgrade to url-regex-safe@v3.0.0+ AND install re2 as an additional dependency in your project via `npm install re2` or `yarn add re2`.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32
npm ERR! code 1
npm ERR! path C:\Users\Lucas\Javascript\plswork\node_modules\re2
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-93.br ...
npm ERR! Trying https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-93.gz ...
npm ERR! Building locally ...
npm ERR!
npm ERR! > re2@1.15.4 rebuild
npm ERR! > node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.13.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.0 found at "C:\Users\Lucas\AppData\Local\Programs\Python\Python38\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2017
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\Lucas\Javascript\plswork\node_modules\re2\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lucas\\Javascript\\plswork\\node_modules\\re2\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Lucas\Javascript\plswork\node_modules\re2
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node:internal/process/promises:246
npm ERR!           triggerUncaughtException(err, true /* fromPromise */);
npm ERR!           ^
npm ERR!
npm ERR! [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
npm ERR!   code: 'ERR_UNHANDLED_REJECTION'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lucas\AppData\Local\npm-cache\_logs\2022-02-07T01_02_37_459Z-debug.log

I noticed one thing on the error log this time: npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community". That's where VS 2022 is installed, for whatever reason it's saying its version is "undefined", don't know if that's the problem or not.

lucassilvas1 commented 2 years ago

Also noticed this on the log: npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt even though I did set the VCINSTALLDIR environment variable correctly.

algorithm117 commented 2 years ago

Hmmm that's quite strange. Can you try running npm config set msvs_version 2017 command

lucassilvas1 commented 2 years ago

I did and the error changed a bit:

npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2017
npm ERR! gyp ERR! find VS running in VS Command Prompt, installation path is:
npm ERR! gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio"
npm ERR! gyp ERR! find VS - will only use this version
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS msvs_version does not match this VS Command Prompt or the
npm ERR! gyp ERR! find VS installation cannot be used.
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use

(only copied the relevant part)

algorithm117 commented 2 years ago

Okay nice! Let's try these two commands. 1) npm config set msbuild_path "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe" 2) If above doesn't work, try this -> npm i -g windows-build-tools

lucassilvas1 commented 2 years ago

Still couldn't install the module after running step one. I'm getting stuck at "reify:resolve: timing reifyNode:node_modules/windows-build-tools/node_modules/ajv" when I run step two. Tried installing windows-build-tools through chocolatey (suggested solution on github) and it didn't help, still stuck.

lucassilvas1 commented 2 years ago

Finally figured it out...

Unistalled VS 2022 (didn't help).

  1. Installed VS 2017 build tools.
  2. Set VCINSTALLDIR to C:\Program Files (x86)\Microsoft Visual Studio\2017\ (not sure if it has any effect)
  3. Ran _npm config set msbuildpath C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
  4. Ran _npm i instagrammqtt and it worked.

Thanks.

algorithm117 commented 2 years ago

I’m glad you were able to figure it out! Definitely a learning process for both of us and I hope your solution helps someone else in the future!