Can't Build OGS Dev Environment

I cloned the git repository and tried to follow these instructions. I’m running Ubuntu. When I run npm run yarn install, I get the error below. Anyone know what I’m missing?

> online-go.com@5.1.0 yarn /home/xxxxxx/Documents/Development/online-go.com
> yarn "install"

/home/xxxxxx/Documents/Development/online-go.com/node_modules/yarn/lib/cli.js:46099
  let {
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    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)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/david/Documenti/Development/online-go.com/node_modules/yarn/bin/yarn.js:24:13)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

npm ERR! Linux 4.4.0-165-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "yarn" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! online-go.com@5.1.0 yarn: `yarn "install"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the online-go.com@5.1.0 yarn script 'yarn "install"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the online-go.com package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     yarn "install"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs online-go.com
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls online-go.com
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/david/Documenti/Development/online-go.com/npm-debug.log
1 Like

Edit: before all of this make sure you do apt install nodejs

since you’re on linux; you can simply clone the repo,
type cd /home/xxxxxx/Documents/Development/online-go.com
and then type make

I tried that, but the makefile runs “npm run yarn install” and it gives the exact same error.

can I double check that you definitely ran apt install nodejs first?

also, can I double check that after cd /home/xxxxxx/Documents/Development/online-go.com
you did the step sudo npm install -g yarn
(make is meant to do this for you, but possibly it isn’t for some reason)

Yes, I installed nodejs. I have version 4.2.6~dfsg-1ubuntu4.2 installed. Is that too old?

And yes, sudo npm install -g yarn was run. Output from that:
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/lib
└── yarn@1.19.1

It looks like you have the correct version of yarn, but I think maybe nodejs might be your problem since they’re currently up to version 12 and you’re using version 4… will running apt install nodejs (which will update to the latest version known to your package manager) break other dev environments in your system that may be relying on the older version?

4.2.6 is the latest known to my package manager. I’m on Ubuntu 16.04 LTS. Seems like Ubuntu isn’t stay up to date even though it’s LTS! :frowning:

This shows node V12 being installed on Ubuntu:

1 Like

Thanks for the tag in! If his last reply was anything like what he posted, I was gonna call in the big dogs :stuck_out_tongue: snap, you saved me a couple tags :wink:

So I need the PPA. Thanks! I’ll give it a try. I recommend updating the docs to note what version of Node.js you need and to go after the PPA if you’re distro isn’t at the latest.

The docs are part of the codebase :wink:

1 Like

Minimum required to run is found here

As a long time Windows power user who will be switching over to Kubuntu in the next couple of months, I find this conversation both interesting and, dare I say, a bit sexy :scream:. I love watching computer nerds work :pleading_face:

1 Like

You were born for Linux. You’re wasted on Windows. Switch and don’t look back.

… Also, sorry but I’m married :wink:

5 Likes

You should consider the Node Version Manager, it lets you manage which version you are using and manage running several node versions simultaneously.

It’s pretty useful.

3 Likes

I was referring to CONTRIBUTING.md. It says install Node.js but doesn’t specify which version, so I assumed any would do.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.