swarmsim / swarm

Swarm Simulator, an idle game with lots of bugs.
https://www.swarmsim.com
GNU General Public License v3.0
479 stars 140 forks source link

./install.sh on Ubuntu 18.04 #719

Open kylechallis opened 4 years ago

kylechallis commented 4 years ago

I realize that the install.sh script specifies that it's only been tested on Ubuntu 17.10, so if you don't have time to address this, I understand.

I was having issues using install.sh and/or npm install to get the project up and running on my Ubuntu 16.10 droplet, so I spun up a brand new 18.04 Digital Ocean droplet just to test out Swarm. Without doing anything else, I cloned the repo and executed install.sh. The issues I'm seeing are similar to those I was seeing on the 16.10 droplet.

Rather than risk incorrectly dissecting and interpreting any of it, I'll just share the entire output:

root@ubuntu-18:~/swarm# ./install.sh
+ sudo apt-get update
Get:1 http://mirrors.digitalocean.com/ubuntu bionic InRelease [242 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease [88.7 kB]     
Get:3 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease [74.6 kB]   
Hit:4 https://deb.nodesource.com/node_8.x bionic InRelease                          
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://mirrors.digitalocean.com/ubuntu bionic-updates/main amd64 Packages [833 kB]
Get:7 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 Packages [1044 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [609 kB]                                  
Get:9 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [199 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [634 kB]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [213 kB]
Fetched 4025 kB in 2s (2577 kB/s)                                    
Reading package lists... Done
+ sudo -E bash -
+ curl -sL https://deb.nodesource.com/setup_8.x

================================================================================
================================================================================

                              DEPRECATION WARNING                            

  Node.js 8.x LTS Carbon is no longer actively supported!

  You will not receive security or critical stability updates for this version.

  You should migrate to a supported version of Node.js as soon as possible.
  Use the installation script that corresponds to the version of Node.js you
  wish to install. e.g.

   * https://deb.nodesource.com/setup_10.x — Node.js 10 LTS "Dubnium" (recommended)
   * https://deb.nodesource.com/setup_12.x — Node.js 12 LTS "Erbium"

  Please see https://github.com/nodejs/Release for details about which
  version may be appropriate for you.

  The NodeSource Node.js distributions repository contains
  information both about supported versions of Node.js and supported Linux
  distributions. To learn more about usage, see the repository:
    https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 20 seconds ...

## Installing the NodeSource Node.js 8.x LTS Carbon repo...

## Populating apt-get cache...

+ apt-get update
Get:1 http://mirrors.digitalocean.com/ubuntu bionic InRelease [242 kB]
Hit:2 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease                                                                                  
Hit:3 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease                                                                                
Hit:4 https://deb.nodesource.com/node_8.x bionic InRelease                                                                                             
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                
Fetched 242 kB in 0s (541 kB/s)                    
Reading package lists... Done

## Confirming "bionic" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_8.x/dists/bionic/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js 8.x LTS Carbon repo...

+ echo 'deb https://deb.nodesource.com/node_8.x bionic main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_8.x bionic main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Get:1 http://mirrors.digitalocean.com/ubuntu bionic InRelease [242 kB]
Hit:2 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease                                                                                  
Hit:3 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease                                                                                
Hit:4 https://deb.nodesource.com/node_8.x bionic InRelease                                                                                             
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                
Fetched 242 kB in 0s (548 kB/s)                    
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 8.x LTS Carbon and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

+ sudo apt-get install -y git nodejs ruby ruby-dev phantomjs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby is already the newest version (1:2.5.1).
ruby-dev is already the newest version (1:2.5.1).
phantomjs is already the newest version (2.1.1+dfsg-2).
git is already the newest version (1:2.17.1-1ubuntu0.5).
nodejs is already the newest version (8.17.0-1nodesource1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo npm install -g yo generator-angular grunt-cli bower
npm WARN deprecated bower@1.8.8: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN deprecated generator-angular@0.16.0: Deprecated
npm WARN deprecated graceful-fs@2.0.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated tough-cookie@0.9.15: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hawk@1.0.0: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek@0.9.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles@0.2.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@0.2.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated boom@0.4.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower
/usr/bin/grunt -> /usr/lib/node_modules/grunt-cli/bin/grunt
/usr/bin/yo -> /usr/lib/node_modules/yo/lib/cli.js
/usr/bin/yo-complete -> /usr/lib/node_modules/yo/lib/completion/index.js

> yo@3.1.1 postinstall /usr/lib/node_modules/yo
> yodoctor

Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
✔ yo version

Everything looks all right!
npm WARN notsup Unsupported engine for global-agent@2.1.7: wanted: {"node":">=10.0"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: global-agent@2.1.7
npm WARN generator-angular@0.16.0 requires a peer of generator-karma@>=0.9.0 but none is installed. You must install peer dependencies yourself.

+ grunt-cli@1.3.2
+ yo@3.1.1
+ bower@1.8.8
+ generator-angular@0.16.0
updated 4 packages in 15.686s
+ sudo gem install compass
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.3
Parsing documentation for compass-1.0.3
Done installing documentation for compass after 0 seconds
1 gem installed
+ sudo npm update -g yo generator-angular grunt-cli bower
+ sudo npm cache verify
Cache verified and compressed (~/.npm/_cacache):
Content verified: 1904 (40360044 bytes)
Content garbage-collected: 2 (33048 bytes)
Index entries: 2561
Finished in 3.701s
+ basename /root/swarm
+ [ swarm != swarm ]
+ npm install

> terraform-npm@0.2.6 postinstall /root/swarm/node_modules/terraform-npm
> node src/install-terraform

'tools/' directory does not exist, creating...
Downloading zipped Terraform executable from https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip...
[====================================================================================================================================================================] 100%
Download finished.
Unzipping archive at tools/terraform.zip...
An error occurred while unzipping: Error: end of central directory record signature not found
npm WARN lifecycle swarm@1.1.13~postinstall: cannot run in wd swarm@1.1.13 bower install (wd=/root/swarm)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: terraform-npm@0.2.6 (node_modules/terraform-npm):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: terraform-npm@0.2.6 postinstall: `node src/install-terraform`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 40

audited 12341 packages in 7.686s
found 163 vulnerabilities (48 low, 48 moderate, 65 high, 2 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
+ bower install
+ yes
bower ESUDO         Cannot be run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using "--allow-root" option

P.S. Thank you for your time :) Love the game, I've spent countless hours on it

erosson commented 4 years ago

Hey, sorry for lagging on this!

It's been a while since I've run the server; things are a little out of date. Just pushed a few updates that got things working again for me on my Ubuntu 19.10 machine. The problem above was that install.sh wasn't expecting to be run as root, but there were a few other things I ran into too. Let me know if this helps!

You might also be interested in running the upcoming the 1.2.0 beta version, https://gitlab.com/erosson/swarm-elm . It's a mostly-feature-complete rewrite that I hope will eventually replace what's on www.swarmsim.com .

kylechallis commented 4 years ago

Thank you!!

After trying to run the install command on a fresh Digital Ocean droplet of 19.10, I was still having one issue. But I seem to have figured it out, and it's working now.

I was getting this error when the script was trying to install compass:

Building native extensions. This could take a while...
ERROR:  Error installing compass:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/ffi-1.12.2/ext/ffi_c
/usr/bin/ruby2.5 -r ./siteconf20200211-12778-pb62ya.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

... (and then much later in the script output) ...

Running "concurrent:test" (concurrent) task

    Loading "cdnify.js" tasks...ERROR
    >> ReferenceError: primordials is not defined

    Running "compass:dist" (compass) task
    Warning: not found: compass Use --force to continue.

    Aborted due to warnings.

Running apt-get install gcc make seemed to be the trick to allowing gem install compass to work properly. From there, I was able to re-run the install.sh script, cd into the swarm/ directory, and npm start to run the server!

Thank you again! Very excited to play around with this 😸