amazon-archives / aws-serverless-auth-reference-app

Serverless reference app and backend API, showcasing authentication and authorization patterns using Amazon Cognito, Amazon API Gateway, AWS Lambda, and AWS IAM.
Other
754 stars 193 forks source link

Ionic App does not start #35

Closed rakeshtembhurne closed 6 years ago

rakeshtembhurne commented 6 years ago

Followed all steps. In last step where app has to be started, it fails. Here's content of file: /home/aws-serverless-auth-reference-app/app/npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'watch' ]
2 info using npm@3.10.10
3 info using node@v6.9.5
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle SpaceFinder@~prewatch: SpaceFinder@
6 silly lifecycle SpaceFinder@~prewatch: no script for prewatch, continuing
7 info lifecycle SpaceFinder@~watch: SpaceFinder@
8 verbose lifecycle SpaceFinder@~watch: unsafe-perm in lifecycle true
9 verbose lifecycle SpaceFinder@~watch: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/aws-serverless-auth-reference-app/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle SpaceFinder@~watch: CWD: /home/aws-serverless-auth-reference-app/app
11 silly lifecycle SpaceFinder@~watch: Args: [ '-c', 'ionic-app-scripts watch' ]
12 silly lifecycle SpaceFinder@~watch: Returned: code: 137  signal: null
13 info lifecycle SpaceFinder@~watch: Failed to exec watch script
14 verbose stack Error: SpaceFinder@ watch: `ionic-app-scripts watch`
14 verbose stack Exit status 137
14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid SpaceFinder@
16 verbose cwd /home/aws-serverless-auth-reference-app/app
17 error Linux 4.4.0-59-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
19 error node v6.9.5
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error SpaceFinder@ watch: `ionic-app-scripts watch`
22 error Exit status 137
23 error Failed at the SpaceFinder@ watch script 'ionic-app-scripts watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the SpaceFinder package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     ionic-app-scripts watch
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs SpaceFinder
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls SpaceFinder
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
justonian commented 6 years ago

Have you tried this again recently? I merged a pull request that locked in the versions of Ionic and Bower for now (which are global NPM modules). In the near future, I'm planning to merge a pull request after fixing a few issues which will fully upgrade the project to the latest versions of Ionic and Angular then allow the latest CLI to be used.

rakeshtembhurne commented 6 years ago

I later figured out that the issue was missing build/vendor.js in file. Here's the diff:

diff --git a/app/src/index.html b/app/src/index.html
index 6141b1b..154437b 100644
--- a/app/src/index.html
+++ b/app/src/index.html
@@ -46,6 +46,7 @@
   <script src="assets/vendor/bower_components/aws-sign-web/aws-sign-web.js"></script>

   <!-- The bundle js is generated during the build process -->
+  <script src="build/vendor.js"></script>
   <script src="build/main.js"></script>

   <!-- Needed for Cordova/PhoneGap (will be a 404 during development) -->

Didn't have any problem with old old versions of Ionic and Cordova (ran only on browser, didn't create apps for iOS/Android).

justonian commented 6 years ago

This issue is now fully fixed. If you pull the latest code and use the latest version of the Ionic CLI "npm install -g ionic" you should be fine. Please let us know if you encounter any other issues. Thanks!