Skip to content

Instantly share code, notes, and snippets.

@glasgowm148
Created March 20, 2019 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glasgowm148/f110ce16932ee258436cfebabcbf8ae9 to your computer and use it in GitHub Desktop.
Save glasgowm148/f110ce16932ee258436cfebabcbf8ae9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# PythonAnywhere config script. Run run.sh after.
echo " ~~~~~~ Foodle : Repo initialisation Bash shell script ~~~~~~ "
echo "The follow file configures the following : "
echo "Setting up venv + installing requirements.txt"
echo "Install & Building npm"
echo "serving using python manage.py runserver"
echo "Estimated time : 1-5 minutes"
echo " ~~~~~~ changing the default directory for npm ~~~~~~ "
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
npm config get prefix
echo " ~~~~~~ add ~/.npm-global to your path ~~~~~~ "
echo 'PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
echo " ~~~~~~ Configuring a local python 3.6 virtualenv ~~~~~~ "
pip3.6 install virtualenv
virtualenv -p python3.6 venv
. venv/bin/activate
echo "~~~~~~ venv activated - installing project requirements.txt ~~~~~~"
pip3.6 install -r requirements.txt
# install globablly (within the environment)
# npm cache verify
# if npm version is < 5 then use `npm cache clean`
# rm -f package-lock.json && npm install
echo ""Moving into the foodle/front-end directory""
echo "$(pwd)"
# foodle - An app within the project, containing the Django Rest Framework views and URL routing
cd foodle/front-end || exit
echo " ~~~~~~ npm install -g @angular/cli@latest - installs the latest version ~~~~~~ "
npm install -g @angular/cli@latest
npm install --save-dev @angular-devkit/build-angular
# update the node package to be on the same cli as the core
npm update
ng update @angular/cli @angular/core
ng audit fix --force
# ng-bootstrap
npm install --save @ng-bootstrap/ng-bootstrap
# Angular Material
npm install --save @angular/material
# https://www.techiediaries.com/django-angular-tutorial/#Fixing_Hot_Code_Reloadnp
#npm install webpack-bundle-tracker --save
# Slightly different than the above statement - not sure why, gives you theme options, etc.
ng add @angular/material
echo " ~~~~~~ ng build... ~~~~~~"
# ng build command writes generated build artifacts to the output folder (/dist)
ng build
echo "~~~~~~ npm installed successfully. ~~~~~~"
# CD back into the home directory ./Foodle_dev
cd ../..
echo "$(pwd)"
echo " ~~~~~~ Current working directory :: ~~~~~~ "
echo "$(pwd)"
echo " ~~~~~~ Dependecy Check :: ~~~~~~ "
npm ls --depth 0
echo " ~~~~~~ Git Stauts :: ~~~~~~ "
git status
echo "~~~~~~ manage.py runserver ~~~~~~"
21:39 ~/Foodle_dev/foodle/front-end (dev)$ ng serve -o
Cannot find module '@angular/compiler-cli'
Error: Cannot find module '@angular/compiler-cli'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/markglasgow148/Foodle_dev/foodle/front-end/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:12:24)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/markglasgow148/Foodle_dev/foodle/front-end/node_modules/@ngtools/webpack/src/index.js:13:10)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/markglasgow148/Foodle_dev/foodle/front-end/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/typescript.js:4:19)
at Module._compile (module.js:652:30)
21:39 ~/Foodle_dev/foodle/front-end (dev)$ npm ls @angular/compiler-cli
/home/markglasgow148/Foodle_dev/foodle/front-end
├── UNMET DEPENDENCY @angular/animations@^7.2.9
├── UNMET DEPENDENCY @angular/cdk@^7.3.5
├── UNMET DEPENDENCY @angular/common@^7.2.9
├── UNMET DEPENDENCY @angular/core@^7.2.9
├── UNMET DEPENDENCY @angular/forms@^7.2.9
└── UNMET DEPENDENCY rxjs@^6.4.0
npm ERR! missing: @angular/animations@^7.2.9, required by front-end
npm ERR! missing: @angular/cdk@^7.3.5, required by front-end
npm ERR! missing: @angular/common@^7.2.9, required by front-end
npm ERR! missing: @angular/core@^7.2.9, required by front-end
npm ERR! missing: @angular/forms@^7.2.9, required by front-end
npm ERR! missing: rxjs@^6.4.0, required by front-end
21:40 ~/Foodle_dev/foodle/front-end (dev)$
/* Older */
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@angular/compiler-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN angular-in-memory-web-api@0.5.4 requires a peer of @angular/common@>=2.0.0 <6.0.0 but none was installed.
npm WARN angular-in-memory-web-api@0.5.4 requires a peer of @angular/core@>=2.0.0 <6.0.0 but none was installed.
npm WARN angular-in-memory-web-api@0.5.4 requires a peer of @angular/http@>=2.0.0 <6.0.0 but none was installed.
npm WARN angular-in-memory-web-api@0.5.4 requires a peer of rxjs@^5.1.0 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: rxjs@6.3.3 (node_modules/@schematics/update/node_modules/rxjs):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Unknown system error -122: Unknown system error -122, close
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: rxjs@6.3.3 (node_modules/@angular-devkit/schematics/node_modules/rxjs):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Unknown system error -122: Unknown system error -122, close
npm ERR! Linux 4.4.0-1075-aws
npm ERR! argv "node" "/usr/bin/npm" "install" "--quiet"
npm ERR! node v8.11.4
npm ERR! npm v4.3.0
npm ERR! code Unknown system error -122
npm ERR! errno -122
npm ERR! syscall close
npm ERR! Unknown system error -122: Unknown system error -122, close
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/markglasgow148/.npm/_logs/2019-03-20T21_32_36_221Z-debug.log
Package install failed, see above.
/home/markglasgow148/Foodle_dev/foodle/front-end
├── UNMET DEPENDENCY @angular/animations@^7.2.9
├── UNMET DEPENDENCY @angular/cdk@^7.3.5
├── UNMET DEPENDENCY @angular/common@^7.2.9
├── UNMET DEPENDENCY @angular/core@^7.2.9
├── UNMET DEPENDENCY @angular/forms@^7.2.9
├── @ng-bootstrap/ng-bootstrap@4.1.0
└── UNMET DEPENDENCY rxjs@^6.4.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @angular/material@7.3.5 requires a peer of @angular/animations@>=7.0.0 but none was installed.
npm WARN @angular/material@7.3.5 requires a peer of @angular/cdk@7.3.5 but none was installed.
npm WARN @angular/material@7.3.5 requires a peer of @angular/core@>=7.0.0 but none was installed.
npm WARN @angular/material@7.3.5 requires a peer of @angular/common@>=7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of @angular/common@^7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of @angular/core@^7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of @angular/forms@^7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of rxjs@^6.3.0 but none was installed.
npm WARN @ngtools/webpack@7.3.6 requires a peer of @angular/compiler-cli@>=5.0.0 <8.0.0 || ^7.0.0-beta.0 but none was installed.
/home/markglasgow148/Foodle_dev/foodle/front-end
├── UNMET DEPENDENCY @angular/animations@^7.2.9
├── UNMET DEPENDENCY @angular/cdk@^7.3.5
├── UNMET DEPENDENCY @angular/common@^7.2.9
├── UNMET DEPENDENCY @angular/core@^7.2.9
├── UNMET DEPENDENCY @angular/forms@^7.2.9
├── @angular/material@7.3.5
└── UNMET DEPENDENCY rxjs@^6.4.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @angular/material@7.3.5 requires a peer of @angular/animations@>=7.0.0 but none was installed.
npm WARN @angular/material@7.3.5 requires a peer of @angular/cdk@7.3.5 but none was installed.
npm WARN @angular/material@7.3.5 requires a peer of @angular/core@>=7.0.0 but none was installed.
npm WARN @angular/material@7.3.5 requires a peer of @angular/common@>=7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of @angular/common@^7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of @angular/core@^7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of @angular/forms@^7.0.0 but none was installed.
npm WARN @ng-bootstrap/ng-bootstrap@4.1.0 requires a peer of rxjs@^6.3.0 but none was installed.
npm WARN @ngtools/webpack@7.3.6 requires a peer of @angular/compiler-cli@>=5.0.0 <8.0.0 || ^7.0.0-beta.0 but none was installed.
~~~~~~ ng build... ~~~~~~
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
~~~~~~ npm installed successfully. ~~~~~~
/home/markglasgow148/Foodle_dev
~~~~~~ Current working directory :: ~~~~~~
/home/markglasgow148/Foodle_dev
~~~~~~ Dependecy Check :: ~~~~~~
foodle@1.0.0 /home/markglasgow148/Foodle_dev
└── UNMET DEPENDENCY bootstrap@^4.3.1
npm ERR! missing: bootstrap@^4.3.1, required by foodle@1.0.0
~~~~~~ Git Stauts :: ~~~~~~
On branch dev
Your branch is up-to-date with 'origin/dev'.
nothing to commit, working directory clean
~~~~~~ manage.py runserver ~~~~~~
21:34 ~/Foodle_dev (dev)$ npm link
foodle@1.0.0 /home/markglasgow148/Foodle_dev
├── bootstrap@4.3.1
├── UNMET PEER DEPENDENCY jquery@1.9.1 - 3
└── UNMET PEER DEPENDENCY popper.js@^1.14.7
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none was installed.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none was installed.
/home/markglasgow148/.npm-global/lib/node_modules/foodle -> /home/markglasgow148/Foodle_dev
21:35 ~/Foodle_dev (dev)$ ng build
The build command requires to be run in an Angular project, but a project definition could not be found.
21:35 ~/Foodle_dev (dev)$ cd foodle/front-end/
21:35 ~/Foodle_dev/foodle/front-end (dev)$ ng build
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
21:35 ~/Foodle_dev/foodle/front-end (dev)$ ls
angular.json node_modules package.json package-lock.json src tsconfig.json tslint.json
21:36 ~/Foodle_dev/foodle/front-end (dev)$ cd node_modules/
21:36 ~/Foodle_dev/foodle/front-end/node_modules (dev)$ ls
abbrev cacache ee-first html-entities loader-runner os-browserify require-from-string tapable
accepts cache-base electron-to-ch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment