Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scaffolding-node] Make sure node scaffolding works well with Angular #816

Closed
nellshamrell opened this issue Sep 27, 2017 · 5 comments
Closed
Assignees

Comments

@nellshamrell
Copy link
Contributor

Sample project https://github.com/mgechev/angular-seed

@nellshamrell
Copy link
Contributor Author

This is currently failing on

> [email protected] postinstall /hab/cache/src/angular-seed-0.1.0
> gulp check.versions && gulp build.bundle.rxjs && gulp webdriver && gulp print.banner

[20:02:26] No gulpfile found

Even though there is definitely a gulpfile.ts in the repo (using https://github.com/mgechev/angular-seed)

@nellshamrell
Copy link
Contributor Author

nellshamrell commented Nov 13, 2017

Further investigation:

I think the problem is when we run npm install. Currently, we use these options

npm install \
  --unsafe-perm \
  --loglevel error \
  --fetch-retries 5 \
  --userconfig "$CACHE_PATH/.npmrc"

This returns this error on build

> [email protected] postinstall /hab/cache/src/angular-seed-0.1.0
> gulp check.versions && gulp build.bundle.rxjs && gulp webdriver && gulp print.banner

[20:02:26] No gulpfile found

I originally found if I removed the --unsafe-perm option from npm install (therefore running on the npm install things as root) - it got me past the "No gulpfile" found error. However, it then failed later with this error:

npm WARN lifecycle [email protected]~postinstall: cannot run in wd %s %s (wd=%s) [email protected] gulp check.versions && gulp build.bundle.rxjs && gulp webdriver && gulp print.banner /hab/cache/src/angular-seed-0.1.0

This appears to be due to removing the --unsafe-perm arg from $ node install, as also covered here. So...need to find a way to install gulp, but also be able to run the postinstall script.

Also relevant

@nellshamrell
Copy link
Contributor Author

EOD update -

I got things working up to a point - I needed to manually copy the gulpfile.ts, tools/*, and tsconfig.json to the $CACHE_PATH in order to be able to run $npm install correctly. Now it's failing on some peer dependencies

[00:04:38] Starting 'print.banner'...
Welcome to                _                                   _
   __ _ _ __   __ _ _   _| | __ _ _ __      ___  ___  ___  __| |
  / _` | '_ \ / _` | | | | |/ _` | '__|____/ __|/ _ \/ _ \/ _` |
 | (_| | | | | (_| | |_| | | (_| | | |_____\__ \  __/  __/ (_| |
  \__,_|_| |_|\__, |\__,_|_|\__,_|_|       |___/\___|\___|\__,_|
              |___/

[00:04:38] Finished 'print.banner' after 7.58 ms
added 1490 packages in 51.884s
npm ERR! peer dep missing: typescript@>=2.4.2 <2.5, required by @angular/[email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: typescript@>=2.4.2 <2.5, required by @angular/[email protected]
npm ERR! peer dep missing: typescript@>=2.4.2 <2.5, required by @angular/[email protected]
npm ERR! peer dep missing: typescript@>=2.4.2 <2.5, required by @angular/[email protected]

Haven't figured that out yet, but will pick up again in the morning!

@nellshamrell
Copy link
Contributor Author

Update -

I did get this working, and wrote up a blog post draft about it here habitat-sh/habitat#4074

However, upon review of the blog post, it was pointed out that it is not common for Angular devs to run the Angular app as a service itself. While this workflow is cool for demo purposes, it would be alienating to those who are used to compiling their Angular apps as static assets and then running them through a web server like nginx.

This will likely involve some fundamental rethinking of how the node scaffolding works - but I believe will make it much more powerful. Closing this for now while we rethink that :)

@rsertelon rsertelon changed the title Make sure node scaffolding works well with Angular [scaffolding-node] Make sure node scaffolding works well with Angular Mar 23, 2018
@elliott-davis
Copy link
Contributor

I think it was @nellshamrell's intention that we close this issue

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

No branches or pull requests

2 participants