Unable to install "merged-pooler" module nodeJs - node.js

So I've leased a VPS from Amazon running Ubuntu Server & I'm trying to setup a Litecoin mining pool so I can point my miners to it. (This is meant to be a private pool)
So far I've installed Litecoin packages, updated, and got Litecoind up and running, all blocks downloaded and up to date. I've installed UNOMP and setup the configuration files as directed in the guide I'm using. (Found Here: https://blockgen.net/setup-your-own-mining-pool)
I'm on the very last step which is to run the init.js file and launch the pool.
Unfortunately instead of working, it throws out the following error message. Any help with this would be greatly appreciated--I've been working at this all week long and have exhausted every possible resource on Google that I can find and nothing seems to work. I'm ripping my hair out as we speak ;)
Here is the error that is being thrown out:
ubuntu#ip-172-26-4-125:/home/nick/unomp$ sudo node init.js
module.js:328
throw err;
^
Error: Cannot find module 'merged-pooler'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/nick/unomp/libs/poolWorker.js:1:77)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
**********UPDATE*********
Latest version of NodeJs installed
Latest version of npm install
-This has fixed the "node-gyp" error I was receiving.
The only thing left to do is get 'sudo npm install merged-pooler' to work. It is now kicking out a much smaller different error that I've tried to research but can't find anything on, posted below:
ubuntu#ip-172-26-4-125:/home/nick/unomp$ sudo npm install merged-pooler
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master
git://github.com/UNOMP/node-merged-pool.git
/home/ubuntu/.npm/_cacache/tmp/git-clone-a85b3ede
npm ERR! /home/ubuntu/.npm/_cacache/tmp/git-clone-a85b3ede/.git: Permission
denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-07-31T23_29_34_792Z-debug.log
ubuntu#ip-172-26-4-125:/home/nick/unomp$

You're missing an npm package merged-pooler, which you can install with
npm install merged-pooler

I was having the exact same problem. I managed to solve it by running the following commands. Note: Execute as root:
source ~/.profile
nvm install 0.10.25
nvm use 0.10.25
apt install redis
npm update
npm install bignum
npm install stratum-pool
npm install merged-pooler
And then, finally try running your pool node:
node init.js
Good luck!

Related

JS-libp2p Tutorial Doc "Error: Cannot find module 'libp2p'"

I wanted to start learning to use libp2p and so started up the tutorial documentation and have hit a problem right away.
The Docs: https://docs.libp2p.io/tutorials/getting-started/javascript/
Following along I got to the "Run Libp2p" header. Running the script I get the error message Error: Cannot find module 'libp2p'
When install the module with sudo npm install libp2p there was an error reading:
ursaNative bindings compilation fail. This is not an issue. Modules that depend on it will use fallbacks.
fs.js:115
throw err;
^
Error: EACCES: permission denied, open './stdout.log'
at Object.openSync (fs.js:439:3)
at Object.writeFileSync (fs.js:1190:35)
at Object.<anonymous> (/home/foss/hello-libp2p/node_modules/ursa-optional/rebuild.js:13:10)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
npm WARN hello-libp2p#1.0.0 No description
npm WARN hello-libp2p#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ursa-optional#0.10.1 install: `node rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ursa-optional#0.10.1 install 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! /root/.npm/_logs/2020-03-29T11_05_48_715Z-debug.log
`
I'm not really sure why there's a permission denied portion of the error as this was run as sudo.The problem seems to revolve around that ursa script. Although it might be optional I'm not sure. Does anyone who has worked with libp2p seen this before?
I'm using node12.16.1 and npm6.13.4 on ubuntu 19.10
Figured it out. Needed to, instead of running sudo npm i libp2p after manually installing the binaries, I had to just skip the sudo and it all works fine. This cause a problem though because I can't install modules globally now because using sudo throws the no npm command found.... I'm not too sure how to add the npm path back into the commands for sudo, or why npm is not present in sudo but is regularly.... This is strange. Will likely be resolved with other distros that natively support node v12 instead of v10. Hopefully 20.04lts will fix this.

nodejs install through anaconda causing cross machine compatibility issues on linux

This problem may be hard to reproducibly describe but hopefully this works. I'm using two different machines (laptop and desktop), and following the steps below on both.
I am creating a conda environment like this:
conda create --name webdev --no-default-packages
Then I am only installing nodejs at the moment, like this:
conda install -c conda-forge nodejs
The resulting environment has only three things in it:
# Name Version Build Channel
libgcc-ng 7.2.0 hdf63c60_3 conda-forge
libstdcxx-ng 7.2.0 hdf63c60_3 conda-forge
nodejs 10.8.0 hfc679d8_1 conda-forge
Just to illustrate, I can then create a new react project like this:
create-react-app my-app
cd my-app
npm start
And the web server starts just fine and everything functions as expected. The problem I then have is that if I use my laptop to navigate into the project folder I created on my desktop and try npm start (or vice versa) I get the following error:
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '../scripts/start'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.resolve (internal/modules/cjs/helpers.js:30:19)
at Object.<anonymous> (/home/me/my-app/node_modules/.bin/react-scripts:35:25)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:266:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 start 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! /home/me/.npm/_logs/2018-11-21T01_24_45_031Z-debug.log
Strangely enough I can export the conda environment I created on my desktop, use it to create a new environment on my laptop, and will still get the error when I try to run the project I created on my desktop (and vice versa).

Cannot find module `dist/bin/x.js` when trying to use the command that comes with the package after npm global install

You did npm install -g aVeryCoolPackage and when you want to use aVeryCoolPackage's command in your shell you get an error like this:
Error: Cannot find module '/usr/local/lib/node_modules/aVeryCoolPackage/dist/bin/cli.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at loadAVeryCoolPackage (/usr/local/lib/node_modules/aVeryCoolPackage/bin/aVeryCoolPackage.js:30:3)
at /usr/local/lib/node_modules/aVeryCoolPackage/bin/aVeryCoolPackage.js:44:5
at LOOP (fs.js:1758:14)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
After you cd into /usr/local/lib/node_modules/thePackage to your surprise you see that the folder dist does not exist at all. This is strange. You tried npm uninstall -g aVeryCoolPackage and then npm install -g aVeryCoolPackage again but you run into the same problem when trying to use its command. Everyone else on github is not running into this problem. What is going on?
In my case I had cloned the repo from github. And I did npm install -g aVeryCoolPackage at the same directory as where the repo is, so it actually installed my local copy of it where it has .gitignore the dist folder. As a result I didn't have dist in /usr/local/lib/node_modules/aVeryCoolPackage/ and it threw the Cannot find module error every time it tried to require files in it.
Fun fact: You would have no idea how the error arises if you npm uninstall -g aVeryCoolPackage and npm install -g aVeryCoolPackage at a different directory where the clone of the repo is not there and getting it fixed as a result. It would become one of those mysteries in node development where sometimes you get strange errors and then you stop seeing them.

npm cannot find module

I've been all over Google and StackOverflow, viewing the various threads related to similar issues, but so far nothing has worked. My problem is that npm seems to be installing improperly...or something, I honestly have no idea: Node and npm are a dependency I use to support the Sage Wordpress theme buildout I'm working on on a different machine.
So the issue is that after uninstalling Node (to be safe), and reinstalling, Node seems to be working fine. node -v returns v5.1.0. Great. npm should be installed with it, but when I run npm -v I get the following lovely bit of error:
$ npm
module.js:340
throw err;
^
Error: Cannot find module 'readable-stream'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Users/Daniel/.nvm/versions/node/v5.1.0/lib/node_modules/npm/node_modules/ npmlog/node_modules/are-we-there-yet/index.js:2:14)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
Running any npm command (even just npm) gives me this error, so as suggested in other solutions, I cannot simply run npm install readable-stream. I have also gone through various solutions (removing the node_modules folder, installing via brew, installing via brew without npm, and several others), but none seem to be working.
Any thoughts would be much appreciated.
I was just wrestling with this problem for half an hour (on Mac) after a failed npm update. I'm using Homebrew and I found I had to do the following:
sudo chown -Rv $USER /usr/local/lib/node_modules/ with my username
Then I reinstalled node via Homebrew:
brew uninstall node
brew install node
By this point npm was working again and I went ahead with a successful npm i -g npm
If you're having problems with NPM and you want to reinstall on UNIX I found this to be the easiest solution:
curl -L https://npmjs.org/install.sh | sudo sh
This will reinstall NPM and get it setup to use the latest NPM Version. This will almost always resolve any issues regarding NPM.
When the process is complete you should receive a message saying It worked.
You can run with command line as below:
npm install // you need remove node_modules folder, run npm install

node npm install -g cannot find module config-chain

I configured the node plugins on jenkins to install grunt and bower globally.
When i use it on a project npm install is executed:
npm install -g bower#~1.2.8 grunt-cli#~0.1.11
Unfortunally it breaks immediately returning the following error:
module.js:333
throw err;
^
Error: Cannot find module 'config-chain'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/Users/Shared/Jenkins/Home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_0.11.10/lib/node_modules/npm/node_modules/npmconf/npmconf.js:2:10)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Module.require (module.js:357:17)
I dont think config-chain is an extra plugin necessary to be installed for it to be there.
Any ideas how to fix this?
Edit.: Fixed it thanks to the accepted answer:
npm auto-install isnt supported for mac at this time. I had to download the package manually.
config-chain is npm dependency, so chances are that your npm installation is broken.
Try to reinstall it, or use one of npm forks if npm itself isn't installable on your system for some reason.
Follow this suggest, i resolve it.
"Who ever faces this problem, please do a clean install of ionic"
npm install -g ionic
If it got installed and you're still facing issues, easily install each missing module you face, globally example
npm install -g config-chain
This will re-install all missing modules, as this might have happened when you upgraded your node
https://forum.ionicframework.com/t/cannot-find-module-config-chain/37130/7"
I encountered a different problem.
It appears as though the Jenkins NodeJS plugin was incorrectly downloading and unpacking packages from the Node.js website. When I went to go look at the unzipped folder and did an npm list, there were several packages missing.
I fixed this by telling Jenkins to download a zip file directly and unpack it.
It was the same issue.
I had moved NPM prefix to 'C:\ProgramData\npm\' (you can see your prefix in 'npm config list' command).
After that I should install global packages only under the administrator credentials.

Resources