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

a new project with 0.37 doesn't run with ng serve #616

Closed
metric152 opened this issue May 3, 2016 · 17 comments
Closed

a new project with 0.37 doesn't run with ng serve #616

metric152 opened this issue May 3, 2016 · 17 comments

Comments

@metric152
Copy link

  1. OSX 10.11.3

angular-cli: 0.0.37
node: 4.4.3
os: darwin x64

  1. create a new project with ng new p
    cd into the project and run ng serve
    project doesn't start and dumps a log to console

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Cannot read property 'sourceDir' of undefined
TypeError: Cannot read property 'sourceDir' of undefined
at new Angular2App (/Users/eleitch/tmp/p/node_modules/angular-cli/lib/broccoli/angular2-app.js:30:40)
at module.exports (/Users/eleitch/tmp/p/angular-cli-build.js:6:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)
at /Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/lib/commands/serve.js:64:24
at lib$rsvp$$internal$$tryCatch (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at /Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/Users/eleitch/tmp/p/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)

Select one of the following:

I am filing a bug.

In this case you need the following information:


  1. OS. Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
  2. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version
    npm --version
    npm info angular-cli

And paste the result here.
3. Repro steps. Tell us exactly what you did and how you came to the failure.
If you can give us steps from the moment you created an empty application,
even better! Please try to be as descriptive as you can; this will avoid
unnecessary back and forth. Was this an app that wasn't created using the
CLI? What change did you do on your code? etc.
4. The log given by the failure. Normally this include a stack trace and some
more information.
5. Mention any other details that might be useful.


Thanks! We'll be in touch soon.

I am filing a feature request.

Unfortunately, for now, although we accept proposals, it will be probably be
deferred. It's not that we don't want to hear you, it's that we're focusing
on the beta release and as such we want to keep things a bit tidier than it
will be once this is out in the open.

We're not closed to good ideas, we simply have a limited amount of bandwidth.
There's only 24 hours per day.

I want customer support / I don't know how to do X.

This is unfortunately not the right place. Please join the discussion on
gitter, Stack Overflow or twitter and don't be afraid to post your
questions there. A FAQ will be created with those and it will help answer
questions other people might have as well.

I want to help!

Please read our contributing guidelines;
https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md

If you really want to be part of the crew and start cracking,
try to contact us on gitter. We're never really far and we might have
something just for you!

@metric152
Copy link
Author

I solved the problem. The generated angular-cli.json file is missing a few new properties.
The defaults property was missing. I also had to add the sourceDir child property. After adding these it worked again.

{
  "routes": [],
  "defaults": {
      "sourceDir": "src/client"
  }
}

@metric152
Copy link
Author

The page will start up but not output anything to dist/vendor. Still working on this.

@metric152
Copy link
Author

Finally got it working again. All the node_module includes must be specified in angular-cli-build.js

vendorNpmFiles: ["es6-shim/es6-shim.js",
                    "systemjs/dist/system-polyfills.js",
                    "angular2/bundles/angular2-polyfills.js",
                    "systemjs/dist/system.src.js",
                    "rxjs/bundles/Rx.js",
                    "angular2/bundles/angular2.dev.js",
                    "angular2/bundles/http.dev.js",
                    "angular2/bundles/router.dev.js"]
  });

@hansl
Copy link
Contributor

hansl commented May 4, 2016

Yes. We now never copy your vendor files automatically. You have to specify them.

Also we don't use bundles locally anymore, but that depends on your systemJS configuration and might not be a problem.

Here's our current vendor list:

    vendorNpmFiles: [
      'systemjs/dist/system-polyfills.js',
      'systemjs/dist/system.src.js',
      'zone.js/dist/*.js',
      'es6-shim/es6-shim.js',
      'reflect-metadata/*.js',
      'rxjs/**/*.js',
      '@angular/**/*.js'
    ]

@hansl hansl closed this as completed May 4, 2016
@sharpmachine
Copy link

sharpmachine commented May 10, 2016

the @angular/**/*.js doesn't work.

@sharpmachine
Copy link

I'm also wondering why you won't include those for us? After running ng new we then have to go in make sure our angular-build-cli.js includes all those things manually? That seems like a step backwards.

@metric152
Copy link
Author

I had to nuke my old generated code and place it in a newly configured project. It moved from 0.0.3x to 1.0.0-beta within a few days. Lots of changes happened all at once.

@sharpmachine
Copy link

@metric152 I ran npm update angular-cli and it updated it from 0.0.37 to 0.0.39. I can't get it to update to beta :/

@hansl
Copy link
Contributor

hansl commented May 10, 2016

@sharpmachine You shouldn't build new projects with anything older than the beta.

As for upgrading to the latest beta, try npm install -g angular-cli@beta or just npm install -g angular-cli@latest.

@Federico-Comesana
Copy link

@hansl I tried to run "npm install -g angular-cli@latest" but then I run "ng -v" and still getting an older version 0.0.39.
How can I force to download latest beta version?

@metric152
Copy link
Author

Try upgrade instead of install

On Monday, June 13, 2016, Federico-Comesana notifications@github.com
wrote:

@hansl https://github.com/hansl I tried to run "npm install -g
angular-cli@latest" but then I run "ng -v" and still getting an older
version 0.0.39.
How can I force to download latest beta version?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#616 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AANCOrRYOyqPJq-Vmy5VmWHLUT68dGdkks5qLbsAgaJpZM4IWkMQ
.

@filipesilva
Copy link
Contributor

@Federico-Comesana we recently added https://github.com/angular/angular-cli#updating-angular-cli, it should help you upgrade.

@Federico-Comesana
Copy link

@filipesilva I've followed your link and still have an old angular-cli version (now is 0.0.33).

Do am I missing something?
I had run:

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest

I'm running "ng -v" in my home folder.

My environment:

  • Ubuntu 14.04.4 LTS
  • angular-cli: 0.0.33
  • node: 5.11.1
  • npm: 3.8.6

@filipesilva
Copy link
Contributor

@Federico-Comesana that's really weird. Try forcing the version manually npm install -g angular-cli@1.0.0-beta.6.

@sambanthar
Copy link

just need to update everytime i need to uninstall and install again i need to migrate my project to latest one its not good

@dchinn
Copy link

dchinn commented Dec 7, 2016

update instructions don't work for me either. currently latest is 22, and , even after following the 'update' instructions, i'm stuck at beta 15

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants