cazala / coin-hive

CoinHive cryptocurrency miner for node.js
https://www.npmjs.com/package/coin-hive
MIT License
1.98k stars 400 forks source link

npm install fails in official node docker image #76

Closed leopoldodonnell closed 6 years ago

leopoldodonnell commented 6 years ago

I was gong to run coin-hive in a container, so I grabbed the latest node container and attempted to install coin-hive, but sadly ran into an issue.

Here's the Dockerfile

FROM node

# Force the mkdir, the node install fails
RUN mkdir -p /usr/local/lib/node_modules/coin-hive/node_modules/puppeteer
RUN npm install -g coin-hive

Attempting to build the container looks like this...

$ docker build -t coin-hive --rm .
Sending build context to Docker daemon  5.632kB
Step 1/3 : FROM node
 ---> 3d1823068e39
Step 2/3 : RUN mkdir -p /usr/local/lib/node_modules/coin-hive/node_modules/puppeteer
 ---> Running in 194e6784ae25
Removing intermediate container 194e6784ae25
 ---> ec642a8d1dd0
Step 3/3 : RUN npm install -g coin-hive
 ---> Running in 5737d9e5b3c8
npm ERR! opts.mkdirpAsync is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-12-18T16_30_44_644Z-debug.log
The command '/bin/sh -c npm install -g coin-hive' returned a non-zero code: 1

Googling around for ERR! opts.mkdirpAsync is not a function I found the following issue npm throw TypeError: opts.mkdirpAsync is not a function when I run npm link #17129

Is there a workaround or a fix?

cazala commented 6 years ago

https://github.com/cazala/coin-hive#can-i-run-this-on-docker

leopoldodonnell commented 6 years ago

duh - sorry, should have paid more attention - thanks!