Runing npx truffle develop - truffle

This version of µWS is not compatible with your Node.js build:
Error: Cannot find module './uws_darwin_x64_108.node'
Falling back to a NodeJS implementation; performance may be degraded.
Could not find suitable configuration file.
Truffle v5.5.6 (core: 5.5.6)
Node v18.2.0
Run npx truffle develop on a command line

Related

How to run Node.js that is bundled with Electron?

I'm using the better-sqlite3 NPM module which uses a native extension to talk to SQLite from an Electron app.
In order for this to work with Electron, I need to rebuild the native extension so it is compiled with the same version as the Electron app.
"postinstall": "electron-rebuild -f -w better-sqlite3",
However, now if I want to write a Node.js CLI tool that ships with the application, it's going to use the globally installed Node.js which might be the wrong version:
Error: The module '/Users/chet/Code/brain-web/object-system/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 85. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
So my question is how do I run node, but specifically reference the Node.js binary that is shipped with electron?
Edit 1: It looks like you can use ./node_modules/.bin/electron index.js to run any Node.js script. However, the application doesn't exit gracefully and errors don't surface in the CLI.

NPM looking in wrong place for React module

Firstly I am not 100% certain my Question title is accurate being that I am very new to NPM/Node/React/VSCode.
I am following a tutorial and am at a step where I created a React app using the command:
PS C:\Users\me\Desktop\Programming\Net Core> npx create-react-app client-app --use-npm --typescript
Which appears to have successfully installed the app in:
C:\Users\me\Desktop\Programming\Net Core . "Net Core" being the name of the project.
However when I try to run the following in the terminal I get an error that the react-scripts.js module cannot be found:
PS C:\Users\me\Desktop\Programming\Net Core\client-app> npm start
Error: Cannot find module 'C:\Users\me\Desktop\Programming\react-scripts\bin\react-scripts.js'
The fact that it is looking for 'react-scripts" in the Programming folder makes no sense to me.
I am using Visual Studio Code version 1.38
NPM version 6.11.3
Node.js version 10.11.0
Try to run npm install in the directory before you run npm start.

firebase functions error: grpc_node.node was compiled against a different Node.js

I just downloaded and installed a newer node v8.9.4.
Then, I try to run firebase functions locally with command:
firebase serve --only functions --debug
I get the following node js version error:
functions: Cannot start emulator. Error: The module '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
How can I get rid of this error (I would like to use latest node version)
==== UPDATE ====
I tried both npm rebuild and npm install, after that, I run firebase serve --only functions --debug again, but I still get the same error.
===== UPDATE 2 =====
I tried delete the module it complains about by:
rm -rf /usr/local/lib/node_modules/firebase-tools/node_modules/grpc/
Then, run:
npm install grpc
Then, run firebase serve --only functions --debug again, now I get error:
⚠ functions: Cannot start emulator. Error: Cannot find module 'grpc'
Seems it doesn't do what I wished, what should I do now to get rid of this new error???
Solved by sudo npm install -g grpc --allow-root --unsafe

Laravel with Node.js: "Node Sass could not find a binding for your current environment"

So I did not have installed Node before, just standard Laravel. Today I installed Node.js 8 and now one of my older projects tells me the following in the console:
app.js:66591 Uncaught Error: Module build failed: ModuleBuildError: Module build failed: Error: Missing binding /node_modules/node-sass/vendor/darwin-x64-57/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
Unfortunately, 'npm rebuild node-sass --force' doesn't change anything. I tried to install either Node 6 or 8, but I cannot get rid of the error (site is still working anyway, is Laravel using Node only for npm?).
So what's the solution for this?

How to deploy a production meteor server in 2015?

Meteor has changed, and is missing a production deployment in docs.meteor.com.
I have a pretty nice working meteor app in dev mode. So I bundle it with the new command since bundle has been deprecated:
meteor build ./build/ --architecture os.linux.x86_64
On the production server, I install the latest version of nodejs (currently 0.12), copy and decompress the build.
The Mongo DB is on an other server, so I just redefine PORT, ROOT_URL, MONGO_OPLOG_URL and MONGO_URL environment variables.
But quickly end-up with the too frequently seen fibers missing error:
module.js:338
throw err;
^
Error: Cannot find module 'fibers'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
...........
So, here is what I tried:
npm install fibers#1.0.1 -g # but it fails.
npm install fibers -g succeeds and installs the version 1.0.5
Here is the situation:
root#server:~# npm version
{ npm: '2.5.1',
http_parser: '2.3',
modules: '14',
node: '0.12.0',
openssl: '1.0.1l',
uv: '1.0.2',
v8: '3.28.73',
zlib: '1.2.8' }
root#server:~# npm ls -g | grep fibers
├── fibers#1.0.5
root#server:/opt/meteor/authmonitor-src# meteor list-platforms
browser
server
But I still have the same : Error: Cannot find module 'fibers'
Questions:
Is there an up to date manual on how to deploy meteor applications on local production server?
Why / how should I install fibers module, and which version?
export NODE_PATH=/usr/local/lib/node_modules/ partly helped, but after installing with npm install xxx -g the required modules such as underscore and semver, it ends with an other fiber error: "Error: Module did not self-register."
What would you recommend?
Thanks,
I would use Meteor Up which automates lots of things. Here is a video tutorial from Sacha
Is there an up to date manual on how to deploy meteor applications on local production server?
No, there is no official documentation. The community is waiting for MDG to release galaxy, which will be a paid hosting service for meteor.
Why / how should I install fibers module, and which version?
Based on what you wrote, there are a couple of things I see that could be problems:
After you untar the bundle you need to:
$ cd bundle/programs/server && npm install
You should not need to install any node modules globally in order for your app to work.
It's also recommended that you run the version of node appropriate for your meteor version. Have a look at the changelog and search for 'node'. At the time of this writing, the recommended version is 0.10.33.
hosting
If you are hosting somewhere fairly bare-bones like DigitalOcean or EC2, I'd recommend using Meteor Up for your deploys. If you prefer to do the sysadmin tasks yourself, I suggesting reading my related answers here and here.
Another popular hosting choice is modulus, becuase it's more full-service. You can read some tutorials here and here.

Resources