Skip to content
This repository has been archived by the owner on Feb 10, 2020. It is now read-only.

Error when trying to "./run" #881

Closed
erik78se opened this issue Nov 10, 2018 · 12 comments · Fixed by #900
Closed

Error when trying to "./run" #881

erik78se opened this issue Nov 10, 2018 · 12 comments · Fixed by #900

Comments

@erik78se
Copy link

erik78se commented Nov 10, 2018

I'm unable to get the tutorials site to get started. What am I doing wrong here?

erik@juju-dev:~/tutorials.ubuntu.com$ ./run

yarn run v1.3.2
$ echo 'To build site, please use build-all'
To build site, please use build-all
Done in 0.12s.

yarn run v1.3.2
$ npm-run-all 'serve-examples {@}' --
/bin/sh: 1: npm-run-all: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

erik@juju-dev:~/tutorials.ubuntu.com$ snap list
Name       Version     Rev   Tracking  Publisher   Notes
charm      2.4.4       254   stable    johnsca     classic
core       16-2.35.5   5742  stable    canonical✓  core
docker     18.06.1-ce  321   stable    docker-inc  -
juju       2.4.5       5740  stable    canonical✓  classic
lxd        3.6         9510  stable    canonical✓  -
snapcraft  2.43.1      1871  stable    canonical✓  classic
erik@juju-dev:~/tutorials.ubuntu.com$
@brlin-tw
Copy link
Contributor

Hello, I have this problem as well, try ./run serve tutorials instead.

@mitechie
Copy link
Contributor

@erik78se did ./run serve tutorials work for you?

@pmatulis
Copy link
Contributor

I reproduced this on Bionic. ./run didn't work with any of the invocations.

@erik78se
Copy link
Author

@erik78se did ./run serve tutorials work for you?

I haven't had the time to try.

@erik78se
Copy link
Author

I have multiple issues apart from this. For example, how to serve on a different IP than "localhost". Since I develop in a virtual environment, its needed, and needed to explain - since I won't be able to see the result once I manage to produce it.

@pmatulis
Copy link
Contributor

I did eventually get this stuff to work. It seems a little wobbly though. Just re-invoking the same commands shouldn't make it work, but it did.

Re remote aspect, you can use SSH local port forwarding. That's what I do. It does make a screenshot of a browser address field less ideal. There is a way around that as well if that's a concern (i.e. locally route a public IP to the forwarded port on the localhost).

@anthonydillon
Copy link
Contributor

@nottrobin do you know what could improve this? I can't reproduce it.

@pmatulis
Copy link
Contributor

The problem, for me anyway, has to do with root privileges being required to connect to Docker when it's installed as a snap.

This is what I did on a fresh Bionic cloud instance with user 'ubuntu':

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo adduser ubuntu docker
newgrp docker
git clone https://github.com/canonical-websites/tutorials.ubuntu.com.git
cd tutorials.ubuntu.com
./run

Thanks to @caldav for the Docker script idea.

@nottrobin nottrobin self-assigned this Nov 13, 2018
@erik78se
Copy link
Author

I hope you can get this solved as it wouldn't be a big issue for me to transfer my stuff into a tutorial after that for you to improve and decide if it should go into the official tutorials or not.

@nottrobin
Copy link
Contributor

nottrobin commented Dec 17, 2018

@erik78se it looks to me like your yarn dependencies might not be installed correctly. Could you try ./run clean followed by ./run again, and let me know if it helps at all?

@pmatulis yes you do need Docker to be able to run without root to use the run script. This usually requires you to add your user to the docker group, but may need extra steps with the snap version, I'm not sure. If you discover what's needed for the snap and it's not entirely straightforward, I'm sure the docker snap project would appreciate a bug report. But this doesn't look like the same issue that @erik78se was having.

If you don't want to use the ./run script, you can always try to run without docker.

@nottrobin
Copy link
Contributor

nottrobin commented Dec 17, 2018

For example, how to serve on a different IP than "localhost"

Actually it already shouldn't care about the hostname. So if you just discover the IP address of your host machine (e.g. with ip addr or ifconfig) then you should just be able to point to http://{host-ip-address}:8016.

@nottrobin
Copy link
Contributor

nottrobin commented Dec 17, 2018

I just submitted #900 which will hopefully help with the dependency management so people shouldn't encounter @erik78se's problem after this PR is merged.

But for now, you might was well try ./run clean anyway 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants