uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
479 stars 53 forks source link

Google's firebase-tools installation failing #168

Closed matheuskknd closed 1 year ago

matheuskknd commented 1 year ago

Hello. How are you doing?

I'm using Google's firebase-tools node package with Python3 nodeenv module to work with node 14.21.3 and npm 6.14.18 on Windows 10. And my project was working fine until a week ago. Today I updated firebase-tools and firebase script is not being installed anymore. Here are the commands I executed on CMD:

python3 -m nodeenv --node=14.21.3 --npm=6.14.18 --with-npm .venv
.venv\Scripts\activate.bat
npm install firebase-tools

Then I go the following log:

(.venv) B:\Software\deracbot>npm install -g firebase-tools
npm WARN deprecated request@2.88.2: request has been deprecated, 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 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 @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
B:\Software\deracbot\.venv\Scripts\firebase -> B:\Software\deracbot\.venv\Scripts\node_modules\firebase-tools\lib\bin\firebase.js

> re2@1.18.2 install B:\Software\deracbot\.venv\Scripts\node_modules\firebase-tools\node_modules\re2
> install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild

Trying https://github.com/uhop/node-re2/releases/download/1.18.2/win32-x64-83.br ...
Trying https://github.com/uhop/node-re2/releases/download/1.18.2/win32-x64-83.gz ...
Building locally ...

> re2@1.18.2 rebuild B:\Software\deracbot\.venv\Scripts\node_modules\firebase-tools\node_modules\re2
> node-gyp rebuild

(.venv) B:\Software\deracbot\.venv\Scripts\node_modules\firebase-tools\node_modules\re2>if not defined npm_config_node_gyp (node "B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.11.33529.622) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - missing any Windows SDK
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:390:5)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at maybeClose (internal/child_process.js:1088:16)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command "B:\\Software\\deracbot\\.venv\\Scripts\\node.exe" "B:\\Software\\deracbot\\.venv\\Scripts\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd B:\Software\deracbot\.venv\Scripts\node_modules\firebase-tools\node_modules\re2
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! re2@1.18.2 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the re2@1.18.2 rebuild 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!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2023-05-25T18_30_13_171Z-debug.log
(node:15784) UnhandledPromiseRejectionWarning: 1
(Use `node --trace-warnings ...` to show where the warning was created)
(node:15784) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15784) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

> protobufjs@7.2.3 postinstall B:\Software\deracbot\.venv\Scripts\node_modules\firebase-tools\node_modules\protobufjs
> node scripts/postinstall

npm WARN notsup Unsupported engine for firebase-tools@12.2.1: wanted: {"node":">=16.13.0 || >=18.0.0"} (current: {"node":"14.21.3","npm":"6.14.18"})
npm WARN notsup Not compatible with your version of node/npm: firebase-tools@12.2.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\firebase-tools\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for yaml@2.3.0: wanted: {"node":">= 14","npm":">= 7"} (current: {"node":"14.21.3","npm":"6.14.18"})
npm WARN notsup Not compatible with your version of node/npm: yaml@2.3.0

+ firebase-tools@12.2.1
added 632 packages from 490 contributors in 116.592s

(.venv) B:\Software\deracbot>

Google's firebase-tools package is updated varios times per week. But this repository is not updated so much and I saw it was updated less than an hour ago, that why I'm opening the issue here first.

I'm not sure, but I guess the problem is that "https://github.com/uhop/node-re2/releases/download/1.18.2/win32-x64-83.gz" is not found by NPM while in older versions it was? (I'm not sure)

Thanks in advance

uhop commented 1 year ago

It looks like:

gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at B:\Software\deracbot\.venv\Scripts\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:390:5)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at maybeClose (internal/child_process.js:1088:16)

What help exactly do you need?

In case you'll find it helpful to compare with working versions: https://github.com/uhop/node-re2/issues/166#issuecomment-1563287189

matheuskknd commented 1 year ago

Thank you for the quick replay. After some attemps changing between Node versions I got firebase-tools installed and working for my tests with dialogflow-fulfillment library.

I think Google removed support for Node 14 in firebase-tools version 12.0.0 and greater for Functions CLI. It seems that's all running fine despite the BADENGINE warning.

Closing this issue.