This article is a hands-on article for reviewing and fixing the knowledge gained by developing Serverless Web App Mosaic. It is one of w2or3w / items / 87b57dfdbcf218de91e2).
I developed it on Cloud9, so I will start by building that environment. Allows you to develop and build Vue web apps, Python (3.6) for Lambda, etc.
AWS Management Console> AWS Cloud9
--Press the Create environment button.
$ npm install -g @vue/[email protected]
$ vue --version
@vue/cli 3.11.0
If you do not specify @ 3.11.0, the latest version will be included. As of mid-December 2019, 4 has just been released. I think that there is no problem with 4, but this time it is hands-on, so just in case, specify the version and install it.
The project created by Vue CLI 3 is separate article.
When I cloned a project created with Vue CLI and tried to build it, I got the following error.
$ npm run build
> [email protected] build /home/ec2-user/environment/sample_vue_project
> vue-cli-service build
sh: vue-cli-service: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ec2-user/.npm/_logs/2020-01-01T02_04_19_354Z-debug.log
To solve this, execute the following command.
$ rm -rf node_modules package-lock.json && npm install
Around October 2019, the standard installed Python version of Cloud9 was 2.7. Since the end of support for Python2 is approaching January 2020, I was thinking of writing the procedure for changing from 2.7 to 3.6. As of mid-December 2019, the standard installed Python version of Cloud9 was already 3.6.8. Thank you very much. That helps a lot.
As I thought, the reference Python of pip is still 2.7 ,. What is it? Is it a trap? Let's change it to refer to 3.7 as follows.
$ pip --version
pip 9.0.3 from /usr/lib/python2.7/dist-packages (python 2.7)
$ sudo update-alternatives --config python
There are 2 programs which provide 'python'.
Selection Command
-----------------------------------------------
*+ 1 /usr/bin/python2.7
2 /usr/bin/python3.6
Enter to keep the current selection[+], or type selection number: 2
$ pip --version
pip 9.0.3 from /usr/lib/python3.6/dist-packages (python 3.6)
Although it is my private development environment, it is a Chromebook (50,000 yen) with 4GB of memory and Cloud9 of t2.micro. It's not a comfortable environment at all, but in a sense it's a bond, a constraint, or enjoying the inconvenience.
But Cloud9 is good. You can start developing right away, and you can access it from anywhere and any PC with the internet and a web browser.
The hands-on environment is decided by Cloud9.
Recommended Posts