-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Dev Dependencies (like Gulp, etc) getting built and build is failing because of which Gulp integration is not working currently. #1740
Comments
I finally reproduced the problem, and I believe this to be a problem with how nativescript-cli handles npm dependencies. Steps to reproduce:
Working around the problem is easy, but not obvious -- don't call |
Was struggling with the same problem! I can confirm that using |
Hey @rosen-vladimirov, Can you post here more info why we have our own nmp and why we do not use the instilled one. What problems we solved? Thanks |
Hi @enchev , How does npm workNativeScript projects rely on npm and npm's structure. This means that each project has package.json with dependencies and devDependencies. When you call How does NativeScript CLI handle dependenciesDue to known behavior of NativeScript's require, all dependencies used in a project must be flattened when copied to The problemWhen npm 3.x.x is installed and user executes The workaroundNativeScript CLI has Why npm as dependencyIn case we rely on user's npm version we have to:
|
Dragging our own pinned version of npm is a workaround that seems to work for many cases, but it's nothing more than a workaround. I believe we have to get rid of it -- the breakage caused by a command such as I'm probably oversimplifying everything, but can we rely on the user running |
Please excuse me, but relying on a specific version of a library is not a workaround for me. In the same manner we can drop all of our dependencies and ask the users to install them globally. I agree that Also we cannot rely on user's calling of
That's why CLI calls |
None of this seems to be working for me. I have two NPM libraries included in my package.json:
I install everything using
Any ideas? |
In my case, It resolved by removing the below line |
Hey @Plamen5kov Do you know what's going on here? |
Hi @nraboy
and
are the same. |
This method seems sketchy. Every time I add some NPM libraries I'm going to have to alter them from a package level? No one is going to want to do that. Can't we get the NativeScript CLI to remove certain files? Seems like it wouldn't be too difficult to do. Best, |
Hi @nraboy, |
I'd vote against making the removal of specific files part of the CLI itself too. That would add an unnecessary dependency to the tool. A plugin might do the work instead, though I can't figure what its name would be - "ns-android-toolchain-fixer"? Sounds lame... Can we figure out a better solution? |
I agree with @nraboy that there should be a process in the CLI to automatically clean up duplicate files. From what I read AAPT just removes the |
@ErjanGavalji , I see plugins as encapsulating functionality that is optional for the user. Here we are talking about a plugin which will be required if you want your build to run w/o problems. So I don't think a good thing to put inside a plugin. Also consider the situation of an existing project that was building fine, then you add a new module and it starts failing with some strange build errors. There will be no way for the end user to know that they need to install a plugin to fix those :) |
@PeterStaev You are absolutely right about the optionality of plugins and the hassle for plugin authors. The thing is, the problem happens only with android and only if you include some npm libraries. That's why I want to come up with something better. So sad I can't figure out anything yet :/ |
By the way, moved the dependent-npm related discussion to a separate thread. |
Well, @atanasovg, @Plamen5kov, how about having errors of the kind handled by the runtime via a CLI hook? Can this be done as a general fix for any android tooling problems? |
I think it's a great idea to build a tool that will make every node_module, NativeScript Compatible, but I don't think this tool should be CLI. As @ErjanGavalji said this problem concerns only specific node_modules, only in Android, and CLI should include only functionality concerning both platforms, when possible. I invite everyone to discuss all scenarios we can think of, concerning invalid node_modules, and find a more general solution, which we'll be able to support, keeping in mind the resources available to us. |
If there is a valid way for us to uniquely detect such invalid cases for each Node module out there then we can think of some CLI hook, installed upon Out of curiosity - this is the first such case I am aware of, are there more such ones? If these are some finite number - e.g. 10 modules - then we may approach the problem in a different way. |
The semver.js.gz issue (#1802) we're sometimes seeing for Angular projects is related even if it is caused by another bug -- semver is a dev dependency that should never end up in |
Facing same problem , from last two weeks. no solution so far. NativeScript log manager are very bad, it never tell you where the problems are? . |
should be partially fixed with the merged PR |
From @Headcult on April 26, 2016 11:30
Thanks for the amazing work on integrating Angular 2 with NativeScript at such a good pace. Looking forward for future releases.
The main issue that I'm facing now is:
Dev Dependencies (like Gulp, etc) getting built and build is failing because of which Gulp integration is not working currently.
Can this be fixed at the earliest as we are unable to use Gulp within our project when using Angular 2 and NativeScript?
My Dev Dependencies:
"devDependencies": { "nativescript-dev-typescript": "^0.3.1", "shelljs": "^0.5.3", "typescript": "^1.8.9", "gulp": "^3.9.1", "gulp-debug": "^2.1.2", "gulp-typescript": "^2.12.1", "del": "^2.2.0", "run-sequence": "^1.1.4" }
Build Failure:
`:processDebugResources FAILED
FAILURE: Build failed with an exception.
Execution failed for task ':processDebugResources'.
Copied from original issue: NativeScript/nativescript-angular#195
The text was updated successfully, but these errors were encountered: