jstinlee
By:
jstinlee

Trying to set up a vps for a bot using Node JS

November 17, 2017 362 views
JavaScript Node.js Ubuntu

In terms of setting things up, I have finished setting up SSH keys for the droplet, disabled Root user, and test ran the heroku js example bot script and it ran fine on port 5000.

Attempting to install a bot on Digital Ocean droplet.

Bot uses Node JS (Discord.js) and works perfectly fine on the local machine

I've tried to address the issue by installing the peer dependencies, however it would always end in error.

$ npm install

> node-opus@0.2.7 install /home /joe-bot/node_modules/node-opus
> node-gyp rebuild

gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-98-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home /joe-bot/node_modules/node-opus
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN discord.js@11.1.0 requires a peer of bufferutil@^3.0.0 but none was installed.
npm WARN discord.js@11.1.0 requires a peer of erlpack@hammerandchisel/erlpack but none was installed.
npm WARN discord.js@11.1.0 requires a peer of opusscript@^0.0.3 but none was installed.
npm WARN discord.js@11.1.0 requires a peer of sodium@^2.0.1 but none was installed.
npm WARN discord.js@11.1.0 requires a peer of libsodium-wrappers@^0.5.1 but none was installed.
npm WARN discord.js@11.1.0 requires a peer of uws@^0.14.1 but none was installed.
npm WARN joebot@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-opus@0.2.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-opus@0.2.7 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!     /home /.npm/_logs/2017-11-17T05_09_44_206Z-debug.log

And this is the NPM list

$ npm list

├── UNMET PEER DEPENDENCY bufferutil@^3.0.0
├─┬ ddg@0.0.3
│ └─┬ request@2.25.0
│   ├── aws-sign@0.3.0
│   ├── cookie-jar@0.3.0
│   ├── forever-agent@0.5.2
│   ├─┬ form-data@0.1.4
│   │ ├── async@0.9.2
│   │ ├─┬ combined-stream@0.0.7
│   │ │ └── delayed-stream@0.0.5
│   │ └── mime@1.2.11
│   ├─┬ hawk@1.0.0
│   │ ├─┬ boom@0.4.2
│   │ │ └── hoek@0.9.1 deduped
│   │ ├─┬ cryptiles@0.2.2
│   │ │ └── boom@0.4.2 deduped
│   │ ├── hoek@0.9.1
│   │ └─┬ sntp@0.2.4
│   │   └── hoek@0.9.1 deduped
│   ├─┬ http-signature@0.10.1
│   │ ├── asn1@0.1.11
│   │ ├── assert-plus@0.1.5
│   │ └── ctype@0.5.3
│   ├── json-stringify-safe@5.0.1
│   ├── mime@1.2.11
│   ├── node-uuid@1.4.8
│   ├── oauth-sign@0.3.0
│   ├── qs@0.6.6
│   └── tunnel-agent@0.3.0
├─┬ discord.io@2.5.2
│ ├── cjopus@0.0.4
│ ├── tweetnacl@0.14.5
│ └─┬ ws@1.1.4
│   ├── options@0.0.6
│   └── ultron@1.0.2
├─┬ discord.js@11.1.0
│ ├── long@3.2.0
│ ├── prism-media@0.0.1
│ ├── snekfetch@3.2.9
│ ├── tweetnacl@0.14.5 deduped
│ └─┬ ws@2.3.1
│   ├── safe-buffer@5.0.1
│   └── ultron@1.1.0
├── ejs@2.5.7
├── enmap@0.4.2
├── UNMET PEER DEPENDENCY erlpack@hammerandchisel/erlpack
├─┬ express@4.16.2
│ ├─┬ accepts@1.3.4
│ │ ├─┬ mime-types@2.1.17
│ │ │ └── mime-db@1.30.0
│ │ └── negotiator@0.6.1
│ ├── array-flatten@1.1.1
│ ├─┬ body-parser@1.18.2
│ │ ├── bytes@3.0.0
│ │ ├── content-type@1.0.4 deduped
│ │ ├─┬ debug@2.6.9
│ │ │ └── ms@2.0.0 deduped
│ │ ├── depd@1.1.1 deduped
│ │ ├─┬ http-errors@1.6.2
│ │ │ ├── depd@1.1.1 deduped
│ │ │ ├── inherits@2.0.3
│ │ │ ├── setprototypeof@1.0.3
│ │ │ └── statuses@1.3.1 deduped
│ │ ├── iconv-lite@0.4.19
│ │ ├── on-finished@2.3.0 deduped
│ │ ├── qs@6.5.1 deduped
│ │ ├─┬ raw-body@2.3.2
│ │ │ ├── bytes@3.0.0 deduped
│ │ │ ├── http-errors@1.6.2 deduped
│ │ │ ├── iconv-lite@0.4.19 deduped
│ │ │ └── unpipe@1.0.0 deduped
│ │ └── type-is@1.6.15 deduped
│ ├── content-disposition@0.5.2
│ ├── content-type@1.0.4
│ ├── cookie@0.3.1
│ ├── cookie-signature@1.0.6
│ ├─┬ debug@2.6.9
│ │ └── ms@2.0.0 deduped
│ ├── depd@1.1.1
│ ├── encodeurl@1.0.1
│ ├── escape-html@1.0.3
│ ├── etag@1.8.1
│ ├─┬ finalhandler@1.1.0
│ │ ├─┬ debug@2.6.9
│ │ │ └── ms@2.0.0 deduped
│ │ ├── encodeurl@1.0.1 deduped
│ │ ├── escape-html@1.0.3 deduped
│ │ ├── on-finished@2.3.0 deduped
│ │ ├── parseurl@1.3.2 deduped
│ │ ├── statuses@1.3.1 deduped
│ │ └── unpipe@1.0.0
│ ├── fresh@0.5.2
│ ├── merge-descriptors@1.0.1
│ ├── methods@1.1.2
│ ├─┬ on-finished@2.3.0
│ │ └── ee-first@1.1.1
│ ├── parseurl@1.3.2
│ ├── path-to-regexp@0.1.7
│ ├─┬ proxy-addr@2.0.2
│ │ ├── forwarded@0.1.2
│ │ └── ipaddr.js@1.5.2
│ ├── qs@6.5.1
│ ├── range-parser@1.2.0
│ ├── safe-buffer@5.1.1
│ ├─┬ send@0.16.1
│ │ ├─┬ debug@2.6.9
│ │ │ └── ms@2.0.0 deduped
│ │ ├── depd@1.1.1 deduped
│ │ ├── destroy@1.0.4
│ │ ├── encodeurl@1.0.1 deduped
│ │ ├── escape-html@1.0.3 deduped
│ │ ├── etag@1.8.1 deduped
│ │ ├── fresh@0.5.2 deduped
│ │ ├── http-errors@1.6.2 deduped
│ │ ├── mime@1.4.1
│ │ ├── ms@2.0.0 deduped
│ │ ├── on-finished@2.3.0 deduped
│ │ ├── range-parser@1.2.0 deduped
│ │ └── statuses@1.3.1 deduped
│ ├─┬ serve-static@1.13.1
│ │ ├── encodeurl@1.0.1 deduped
│ │ ├── escape-html@1.0.3 deduped
│ │ ├── parseurl@1.3.2 deduped
│ │ └── send@0.16.1 deduped
│ ├── setprototypeof@1.1.0
│ ├── statuses@1.3.1
│ ├─┬ type-is@1.6.15
│ │ ├── media-typer@0.3.0
│ │ └── mime-types@2.1.17 deduped
│ ├── utils-merge@1.0.1
│ └── vary@1.1.2
├─┬ file-system@2.2.2
│ ├─┬ file-match@1.0.2
│ │ └── utils-extend@1.0.8 deduped
│ └── utils-extend@1.0.8
├── fs@0.0.1-security
├─┬ jade@1.11.0
│ ├── character-parser@1.2.1
│ ├─┬ clean-css@3.4.28
│ │ ├─┬ commander@2.8.1
│ │ │ └── graceful-readlink@1.0.1
│ │ └─┬ source-map@0.4.4
│ │   └── amdefine@1.0.1
│ ├── commander@2.6.0
│ ├─┬ constantinople@3.0.2
│ │ └── acorn@2.7.0
│ ├─┬ jstransformer@0.0.2
│ │ ├── is-promise@2.1.0
│ │ └─┬ promise@6.1.0
│ │   └── asap@1.0.0
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ ├─┬ transformers@2.1.0
│ │ ├─┬ css@1.0.8
│ │ │ ├── css-parse@1.0.4
│ │ │ └── css-stringify@1.0.5
│ │ ├─┬ promise@2.0.0
│ │ │ └── is-promise@1.0.1
│ │ └─┬ uglify-js@2.2.5
│ │   ├─┬ optimist@0.3.7
│ │   │ └── wordwrap@0.0.3
│ │   └─┬ source-map@0.1.43
│ │     └── amdefine@1.0.1 deduped
│ ├─┬ uglify-js@2.8.29
│ │ ├── source-map@0.5.7
│ │ ├── uglify-to-browserify@1.0.2
│ │ └─┬ yargs@3.10.0
│ │   ├── camelcase@1.2.1
│ │   ├─┬ cliui@2.1.0
│ │   │ ├─┬ center-align@0.1.3
│ │   │ │ ├─┬ align-text@0.1.4
│ │   │ │ │ ├─┬ kind-of@3.2.2
│ │   │ │ │ │ └── is-buffer@1.1.5
│ │   │ │ │ ├── longest@1.0.1
│ │   │ │ │ └── repeat-string@1.6.1
│ │   │ │ └── lazy-cache@1.0.4
│ │   │ ├─┬ right-align@0.1.3
│ │   │ │ └── align-text@0.1.4 deduped
│ │   │ └── wordwrap@0.0.2
│ │   ├── decamelize@1.2.0
│ │   └── window-size@0.1.0
│ ├── void-elements@2.0.1
│ └─┬ with@4.0.3
│   ├── acorn@1.2.2
│   └─┬ acorn-globals@1.0.9
│     └── acorn@2.7.0 deduped
├── UNMET PEER DEPENDENCY libsodium-wrappers@^0.5.1
├── ms@2.0.0
├─┬ UNMET DEPENDENCY node-opus@0.2.7
│ ├── bindings@1.2.1
│ ├── UNMET DEPENDENCY commander@2.11.0
│ ├── UNMET DEPENDENCY nan@2.7.0
│ └─┬ ogg-packet@1.0.0
│   └─┬ ref-struct@1.1.0
│     ├─┬ UNMET DEPENDENCY debug@2.6.8
│     │ └── ms@2.0.0 deduped
│     └─┬ ref@1.3.5
│       ├── bindings@1.2.1 deduped
│       ├── UNMET DEPENDENCY debug@2.6.8
│       └── UNMET DEPENDENCY nan@2.7.0
├── UNMET PEER DEPENDENCY opusscript@^0.0.3
├── UNMET PEER DEPENDENCY sodium@^2.0.1
└── UNMET PEER DEPENDENCY uws@^0.14.1

npm ERR! missing: node-opus@0.2.7, required by joebot@1.0.0
npm ERR! peer dep missing: bufferutil@^3.0.0, required by discord.js@11.1.0
npm ERR! peer dep missing: erlpack@hammerandchisel/erlpack, required by discord.js@11.1.0
npm ERR! peer dep missing: opusscript@^0.0.3, required by discord.js@11.1.0
npm ERR! peer dep missing: sodium@^2.0.1, required by discord.js@11.1.0
npm ERR! peer dep missing: libsodium-wrappers@^0.5.1, required by discord.js@11.1.0
npm ERR! peer dep missing: uws@^0.14.1, required by discord.js@11.1.0
npm ERR! missing: nan@2.7.0, required by node-opus@0.2.7
npm ERR! missing: commander@2.11.0, required by node-opus@0.2.7
npm ERR! missing: debug@2.6.8, required by ref-struct@1.1.0
npm ERR! missing: debug@2.6.8, required by ref@1.3.5
npm ERR! missing: nan@2.7.0, required by ref@1.3.5

2 Answers

I've managed to fix it a little so the error is now:

$ npm list

npm ERR! peer dep missing: erlpack@hammerandchisel/erlpack, required by discord.js@11.1.0
npm ERR! peer dep missing: opusscript@^0.0.3, required by discord.js@11.1.0
npm ERR! peer dep missing: uws@^0.14.1, required by discord.js@11.1.0
npm ERR! peer dep missing: sodium@^2.0.1, required by discord.js@11.1.0
npm ERR! peer dep missing: libsodium-wrappers@^0.5.1, required by discord.js@11.1.0

Looks like you just need to install make

sudo apt-get install build-essential

Simon
SnapShooter.io - Better DigitalOcean Backups

Have another answer? Share your knowledge.