question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

I’m getting this error. How to do the development from this project?

Using ng serve cause the error. Any other alternative way?

bash-3.2$ ng serve
You have to be inside an angular-cli project in order to use the serve command.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
FanYeeChokcommented, Apr 3, 2017

@jvandemo Yup. It’s working fine now. Just every time if any changes on ngx-library and need to execute npm run tsc. If got any hot deploy/watch will be better.

Now i moved all the code to the project hello-world for development. If everything work fine, only move back to ngx-library and to the final test.

At the app.module has to import as SampleModule.forRoot() only worked.

1reaction
caroso1222commented, Apr 3, 2017

@FanYeeChok ng serve is throwing error because this is not an angular-cli project.

What you can do is to rely on npm link to use your library in a cli project.

Try this:

  1. Create app with generator: yo angular2-library. Let’s say you go with name ngx-library.
  2. Eventhough the dist folder is generated, go ahead and transpile files again: npm run tsc
  3. Create a new Angular app. Let’s assume you use angular-cli. ng new hello-world
  4. Run npm link inside /ngx-library, and npm link ngx-library inside /hello-world to have your library available inside your Angular app node_modules folder.
  5. Import your new SampleModule module into app.module (add to decorator imports as well). If you have problems when running ng serve, try adding the library to decorator as SampleModule.forRoot().
  6. Create <sample-component></sample-component> in app.component.html. Run ng serve. It should show an h1 with text “Sample Component”. Our library is working.

@jvandemo what do you think about adding to README these or some other indications on how to use the yo library in development?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Serve in Tennis: 6-Step Guide - TennisGate
#1 – FIND THE RIGHT STANCE & GRIP. You can only hit an effective serve from a solid starting position. · #2 –...
Read more >
How to Serve a Tennis Ball (with Pictures) - wikiHow
1. Get in position. Before you begin to serve the ball, you have to stand behind the baseline, on the side opposite the...
Read more >
Tennis Serve Technique – 7 Steps To Correct Serve
If the waiter's position persists, then complement the hitting part exercise with additional drills for correcting the waiter's serve. Step 4: Backswing &...
Read more >
Ultimate Tennis Serve Lesson - How To Serve In Tennis
Ultimate Tennis Serve Lesson - How To Serve In Tennis. The tennis serve is the most complex shot in the sport, there are...
Read more >
11 Steps To Hit A Perfect Tennis Serve
Make contact with the ball with your arm extended straight above your body. For a first serve, you're most likely to contact the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found