Ubuntu 16.04下安装yarn
官方指南:https://yarnpkg.com/lang/en/docs/install/#debian-stable
1.安装nodejs
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install -g n
sudo n latest/sudo n stable
2.配置库
curl -sS 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
3.因为使用了nvm,所以避免安装node,只需执行以下命令:
sudo apt-get update && sudo apt-get install --no-install-recommends yarn
Emoji Scavenger Hunt项目部署
遇到问题:
dev_appserver.py: command not found
In order to start local development we also require the installation of the
and associated
. These are used for the local webserver and pushing to app engine for static site hosting.
rd-dyang@www:~/workspace/emoji-scavenger-hunt$ export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
rd-dyang@www:~/workspace/emoji-scavenger-hunt$ echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
[sudo] password for rd-dyang:
deb http://packages.cloud.google.com/apt cloud-sdk-xenial main
rd-dyang@www:~/workspace/emoji-scavenger-hunt$ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1326 100 1326 0 0 5516 0 --:--:-- --:--:-- --:--:-- 5525
OK
rd-dyang@www:~/workspace/emoji-scavenger-hunt$ sudo apt-get update && sudo apt-get install google-cloud-sdk
Hit:1 https://download.docker.com/linux/ubuntu xenial InRelease
Get:2 http://packages.cloud.google.com/apt cloud-sdk-xenial InRelease [6372 B]
Hit:3 http://dl.yarnpkg.com/debian stable InRelease
Get:4 http://packages.cloud.google.com/apt cloud-sdk-xenial/main amd64 Packages [37.9 kB]
Hit:5 http://archive.canonical.com/ubuntu xenial InRelease
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:7 http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu xenial InRelease
Hit:8 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [785 kB]
Fetched 1045 kB in 3s (335 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python-crcmod
Suggested packages:
google-cloud-sdk-app-engine-java google-cloud-sdk-app-engine-python
google-cloud-sdk-pubsub-emulator google-cloud-sdk-bigtable-emulator
google-cloud-sdk-datastore-emulator kubectl
The following NEW packages will be installed:
google-cloud-sdk python-crcmod
0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
Need to get 16.1 MB of archives.
After this operation, 120 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://packages.cloud.google.com/apt cloud-sdk-xenial/main amd64 google-cloud-sdk all 204.0.0-0 [16.1 MB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-crcmod amd64 1.7-2build2 [17.4 kB]
Fetched 16.1 MB in 1s (8224 kB/s)
Selecting previously unselected package python-crcmod.
(Reading database ... 41826 files and directories currently installed.)
Preparing to unpack .../python-crcmod_1.7-2build2_amd64.deb ...
Unpacking python-crcmod (1.7-2build2) ...
Selecting previously unselected package google-cloud-sdk.
Preparing to unpack .../google-cloud-sdk_204.0.0-0_all.deb ...
Unpacking google-cloud-sdk (204.0.0-0) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up python-crcmod (1.7-2build2) ...
Setting up google-cloud-sdk (204.0.0-0) ...
rd-dyang@www:~/workspace/emoji-scavenger-hunt$ gcloud components install app-engine-python
ERROR: (gcloud.components.install)
You cannot perform this action because the Cloud SDK component manager
is disabled for this installation. You can run the following command
to achieve the same result for this installation:
sudo apt-get install google-cloud-sdk-app-engine-python
rd-dyang@www:~/workspace/emoji-scavenger-hunt$ sudo apt-get install google-cloud-sdk-app-engine-python
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
google-cloud-sdk-app-engine-python
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 4226 kB of archives.
After this operation, 31.5 MB of additional disk space will be used.
Get:1 http://packages.cloud.google.com/apt cloud-sdk-xenial/main amd64 google-cloud-sdk-app-engine-python all 204.0.0-0 [4226 kB]
Fetched 4226 kB in 2s (1446 kB/s)
Selecting previously unselected package google-cloud-sdk-app-engine-python.
(Reading database ... 53229 files and directories currently installed.)
Preparing to unpack .../google-cloud-sdk-app-engine-python_204.0.0-0_all.deb ...
Unpacking google-cloud-sdk-app-engine-python (204.0.0-0) ...
Processing triggers for google-cloud-sdk (204.0.0-0) ...
Setting up google-cloud-sdk-app-engine-python (204.0.0-0) ...
Processing triggers for google-cloud-sdk (204.0.0-0) ...
rd-dyang@www:~/workspace/emoji-scavenger-hunt$
然后,就能正常run the local development server: