React Native Node - node.js

Could not start metro bundler
Getting following error while executing
command : npx react-native start
Node Version : v17.3.0
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported

You can find solution for this question Here
This error is occuring in Node.js 17. Downgrade your node version to an older version (~16).

Related

Does Twilio Flex UI support Node 18 and NPM 8?

I am trying to follow the instructions from Twilio Flex found at: Twilio Flex Quickstart: Getting Started with React Plugin Development
I keep running into errors and can not figure them out. I've tried doing this on Windows and macOS and it's the same result. I am using NVM to use Node.js v18.13.0 and NPM v8.19.3. The only thing I can think of is that maybe Twilio Flex does not support the current versions of Node and NPM. Does anyone know what I'm doing wrong?
Terminal output:
Starting development server (static)...
ℹ 「wds」: Project is running at http://localhost:3100//
ℹ 「wds」: webpack output is served from undefined
ℹ 「wds」: Content not from webpack is served from /Users/username/plugin-sample
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/Users/username/.twilio-cli/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:471:10)
at /Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:503:5
at /Users/username/.twilio-cli/node_modules/webpack/lib/NormalModule.js:358:12
at /Users/username/.twilio-cli/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/Users/username/.twilio-cli/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array.<anonymous> (/Users/username/.twilio-cli/node_modules/loader-runner/lib/LoaderRunner.js:205:4) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.13.0
Here is the commands I have run so far (in order):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts
brew tap twilio/brew && brew install twilio
twilio login
twilio flex:plugins:create plugin-sample --install --flexui2
cd plugin-sample
twilio flex:plugins:start
I have tried installing legacy versions of Node 16 and Node 14 with varying degrees of success. At one point I was able to actually have the plugin running on localhost but I had many errors and it would not let me publish the plugin. Since then, I have not been able to recreate this somewhat successful output.
According to the installation instructions, Node 10.12 through 14 are supported. They are working towards support for 16. So using node 18 would be a very likely cause of the error.
You can switch to a supported version by doing nvm install 14.
To keep this version as your new default, you'll need to set it: nvm alias default 14.

Node application doesn't start with "zeromq.node: undefined symbol: sodium_init" message

Problem
Node application not starts with the following message:
node: symbol lookup error: /home/user/nodeapp/node_modules/zeromq/build/Release/zeromq.node: undefined symbol: sodium_init
Application uses ZeroMQ.js having the following in package.json:
"dependencies": {
"zeromq": "^6.0.0-beta.16"
}
Starting application failed with above message. I'm running:
ubuntu 20.04.5 LTS
node v16.18.1
npm 8.19.2
libzmq3-dev (4.3.2-2ubuntu1)
Workaround
Application starts and run normally if I remove zeromq module and install it with the following command:
npm install zeromq#6.0.0-beta.16 --zmq-shared
But the next time when I run npm install the problem returns.
Question
Is it possible to not manually install ZeroMQ.js Version 6.0.0 in my environment to avoid application failure with undefined symbol message?
Unfortunately I can't upgrade Ubuntu and Node now due to system requirements.
I just created a PR for solving this bug:
https://github.com/zeromq/zeromq.js/pull/553
Hopefully should be merged and released soon. So upstep your zeromq npm-package after that.

how to update reactjs project to nodejs v18.12.0 and npm v8.19.2?

I installed nodejs 18.12.0 and I want to run my reactjs project, after npm start it gives me this errors:
Compiled with problems:X
ERROR in ./src/assets/images/arrow_vector.svg
Module build failed (from ./node_modules/file-loader/dist/cjs.js):
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at getHashDigest (E:\project\KhazaeiCRM-main\node_modules\loader-utils\lib\getHashDigest.js:46:34)
at E:\project\KhazaeiCRM-main\node_modules\loader-utils\lib\interpolateName.js:113:11
at String.replace ()
at interpolateName (E:\project\KhazaeiCRM-main\node_modules\loader-utils\lib\interpolateName.js:110:8)
at Object.loader (E:\project\KhazaeiCRM-main\node_modules\file-loader\dist\index.js:29:48)
after some research, they told me that must install lower version of nodejs,
so I install nodejs 16 and new error is:
Error: PostCSS plugin postcss-import requires PostCSS 8
the solution is to install latest version of nodejs !!
what can I do to update my reactjs project to the latest nodejs version ?
maybe you should use nvm to easy choose other node.js version to run app.

npm run Build:dev error when doing Advance UI Customization

I wanted to customize the UI elements in the publisher portal and followed this guide
But I get the following error when running this in cmd;
npm run build:dev
ERROR in ./node_modules/#material-ui/core/esm/styles/createPalette.js Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: .\Downloads\wso2am-4.1.0\repository\deployment\server\jaggeryapps\publisher\node_modules#material-ui\core\esm\styles\createPalette.js: Unexpected token, expected "," (174:319)
I’m using node version 16.14.0 and npm version 8.9.0.
Can you try with the node version 12.x or 14.x? It works with those versions.

How to understand node version dependencies issue

I am working on a nodejs project. I get below error when launch the application.
Failed to load gRPC binary module because it was not installed for the current system
extensionHostProcess.js:293
Expected directory: node-v57-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/Users/dev/node_modules/firebase/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node
From the description it means there are unmatched native dependencies version related to firebase. I tried npm rebuild which doesn't seem to work. I am using node version:
node: v8.9.4
npm: 6.2.0
How can I fix the dependencies issue? Should I try with particular node version or should I rebuilt some native libraries?

Resources