Seems like Angular Seed template requires running
$ npm install
in project root to download all dependencies (see https://github.com/angular/angular-seed ). If user creates a new HTML5 project from this template, it doesn't work out of box anymore. It is described in README.md, but this file is located in project root (not site root) so users won't see it unless they switch to Files...
Since IDE does not support NodeJS, would it be possible to update template's Description field in New Project wizard (step 3: Site Template) and add information that user must run "npm install" or something like that?
*** Bug 243623 has been marked as a duplicate of this bug. ***
Will make sense, will do it. Thanks for catching that.
Done, please verify.
Integrated into 'main-silver', will be available in build *201404120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Tomas Mysik <email@example.com>
Log: #243618 - Angular Seed template requires npm install
Thank you, unfortunately it seems like running only the command won't help... NPM installs the dependencies to project root and index.html then contains in site root following:
So it references to folder bower_components in project root. But if you run the project, the NetBeans embedded server is not able to serve files from outside of site root:
- project is running on URL
- and it tries to load files from e.g.
And this fails... I'm not sure what could be done. One solution would be to move all dependencies from project root to site root and fix links in HTML files but this is a bit unintuitive. Or to "fix" the embedded server to serve files from outside of site root (no idea if that's even possible)
The same issue is with HTML5 sample project AngularJS Phone Catalog
Sorry, no idea now what we should do here :/ Removing patch-candidate keyword since it won't be an easy fix.
Making this a P1. AngularJS is one of our key features in NetBeans 8 and now it is completely broken.
Maybe the solution is not to get the seed template from the AngularJS repository. Maybe, instead of that, we should bundle the seed template into the IDE in such a way that we have control over it and it works.
Whatever the case, we need to fix this ASAP.
Not a P1 IMHO, so lowering. Will investigate what we can do with it.
Until there are instructions for how to workaround this, or an actual fix, the AngularJS feature in NetBeans 8, one of its key features, is broken. P1.
If I may offer a fix, a simple one could be to add a '.bowerrc' file to the project root, and its content should be as follows:
This will cause bower components to be installed in the directory specified above. And since 'app' directory is the site root, the project should work fine as expected (after running >> npm install).
To fix the issue of project running straight out of the box, how about enabling the IDE build feature for HTML5 projects? - So that a build can be triggered immediately after project initialisation with simple task of running
>> npm install
Subsequent builds may be designated to run
>> npm update # or whatever
hat's just my two pennies' worth.
Additional information here:
@SultanBaby: Thanks a lot for your tip! We will look at it.
Based on , it seems that the current dev build could "work", I guess (we have added an info message). Láďo, could you please check it?
The question is, whether NetBeans should run "npm install" or just inform about it. Any opinions?
Yes, it works with the change if you run npm install (only src pointing to modernizr script is wrong but that's problem in Angular seed, I'll file issue against it).
I think it would be ideal if IDE would run the command and if it fails (npm not found, network issue...) it would show some message. Question is if the new project wizard would wait for npm install to finish or not (it takes some time).
(In reply to Vladimir Riha from comment #14)
> Yes, it works with the change if you run npm install (only src pointing to
> modernizr script is wrong but that's problem in Angular seed, I'll file
> issue against it).
Thanks a lot. Not a P2 anymore, so lowering. Also adding 80patch-candidate keyword, let's put it in the next patch of NB 8.0.
> I think it would be ideal if IDE would run the command and if it fails (npm
> not found, network issue...) it would show some message.
I agree. I will update the description of the template (something like "Ensure that npm is correctly installed on your PC.").
> Question is if the
> new project wizard would wait for npm install to finish or not (it takes
> some time).
Well, I will try both cases and choose the better one.
Since AngularSeed project is fixed now, the NetBeans support works again. I have reported a new issue for calling "npm install" since it will need a bit more work (we don't want to copy & paste code, we likely prefer a support for NPM command line tool, right?) - see issue #244322.