I have created a JS bundle file from node-xmpp using Browserify but when I load my website I get the following error in the Google Chrome Javascript console:
Uncaught Error: Cannot find module 'dns'
I tried installing the browser-request node package using npm install -g browser-request and to rebuild the JS bundle but I still get the same error.
What do I need to include/install in order to get rid of this error?
Note: I am using a debian server with the latest version of nodejs and Browserify
I found an commit that has not been added to the latest build yet that solved my problem.
https://github.com/dodo/node-xmpp/commit/a49e7be0e43885060aaf26c2772b41c618624f12
I've added a screenshot containing the changes for if the link dies:
Related
I am trying to use google-auth-library with a react app but am getting various errors which seem to indicate missing dependencies. The errors are all in a format similar to this:
Module not found: Error: Can't resolve 'buffer' in '/private/tmp/minimal-example/node_modules/buffer-equal-constant-time'
The error messages include details on how to add a polyfill for the missing dependencies, but even after going through and adding all these polyfills I am unable to use the library. The logs for the development server still show errors for missing files, and the browser console has the following error:
GET http://metadata.google.internal./computeMetadata/v1/instance net::ERR_NAME_NOT_RESOLVED
Steps to reproduce:
Install Node 16.13.2
Create a react app npx create-react-app minimal-example
Enter directory for the created project cd minimal-example
Install google-auth-library npm install google-auth-library --save
Add the following code to ./src/App.js
const {GoogleAuth} = require('google-auth-library');
Start the development server npm start
Observe errors
What am I doing wrong?
I Have the same problem with same google-auth-library package!
This is a problem with using webpack 5 on React scripts=> v5
Have three solutions to resolve:
downgrade react-scripts to version 4.0.3. on package.json file.
Overwrite the config webpack config, but, i will need install react-app-rewired to do this, because react app not have webpack.config on tree app files.
you can eject the script to root folder executing npm run eject, but caution, this action is permanent, more here: https://stackoverflow.com/a/48395890
Some people answered this problem in How to Polyfill node core modules in webpack 5
and https://github.com/facebook/create-react-app/issues/12072
I'm trying to build a react app, which is built from the ground up. I use Yarn as my package manager. Whenever I try to run my node server I'm getting the error "Module not found express". which I did install and is a part of my dependencies.
I found out that the module express is being fetched from a node_modules directory instead of the local app directory, is this the issue?
error description
The module is being fetched from here:
"C:/Users/hp/AppData/Local/Microsoft/TypeScript/4.2/node_modules/#types/express/index"
Thanks in advance :)
EDIT
NPM global screenshots
I keep getting an error saying "Cannot find module 'crypto'" I am using meteor and from my understanding, npm recently made crypto deprecated and made it built in however, my site now crashes. As a final issue, I cannot revert because I have not installed the module on my computer and it is no longer available on npmjs.org (I believe).
I have tried: updating meteor and npm, reinstalling the package, meteor reset, running an npm install.
Any ideas?
I am trying to use firebase-admin npm module in a Netlify cloud function. By default netlify-lambda packages the functions with Webpack, which breaks firebase-admin as it's not compatible with Webpack.
I tried using the alternate "zip n ship" method but even that doesn't works. From the error, it seems the node_modules generated on my machine are not working correctly on the machine where the function is deployed. Here is the error:
Error: The gRPC binary module was not installed. This may be fixed by running "npm rebuild"
Original error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node'
Anyone who has made this work?
you can use Webpack to generate new package.json file into the lambda directory and install its dependencies, then run netlify-lambda as this tutorial shows firebase-admin-with-netlify-lambda
I package my app with nw.js v0.12.3 and I'm use dns node.js module. When I started my app with 'nw .' all works fine. But when I package my app with nw-packager I have an error 'Uncaught error: No module dns'.
You need to install the dns module via npm install dns --save (not --save-dev) so it's marked as a post-development dependency ("dependencies": in your package.json file instead of "devDependencies":) and is packaged with your app.
Then you should be able to check that the dns module is packed with your code and the nwjs runtime using a tool such as 7-Zip.
nw-packager uses nw-builder under the hood so any manifest options (package.json) that are documented in nw-builder apply to nw-packager