I'm trying to get a pre-build event setup in visual studio 2012 for compressing my Durandaljs app using Gulp. After much frustration with the pre/post build command line I have it working if I build the project. It runs node/gulp as expected.
My issue now is when I goto publish my project using the publish dialog (web deploy) the command fails with "exited with code 255." along with first alerting "Server was unexpected at this time." I'm having trouble finding much information on this error combination and I don't know what else to try.
if $(ConfigurationName) == Release (
"C:\Program Files\nodejs\node.exe" "$(ProjectDir)node_modules\gulp\bin\gulp.js" --gulpfile "$(ProjectDir)gulpfile.js" --cwd "$(SolutionDir)ProjectName" --no-color durandal
)
Edit: I've reduced the issue down further. It has nothing to do with Gulp, rather it is something with node running from the build command line. I am running a simple helloworld.js file piped into node and it is the same behavior. It works fine on build, however, on publish it gives the same errors.
Related
Being rather new to mobile app development i'm looking at Apache Cordova paired with Tabris.
Tabris requires a particular installation procedure, this creates a ./node_modules sub-folder under the regular ./www folder of a typical cordova project. Build cordova here is not a problem.
After adding 'npm install pouchdb' to ./www/node_modules now the cordova build fails again and again. I don't see what else changed but the addition of pouchdb. Strangely while pouchdb is reported to be just 46KB after installation many more modules were added and it now weighs in at 55MB. I suspect the many extra modules pose an issue.
I suspect i may need to tweak gradle but i'm most clueless where to start.
please advise
--- below the output indicating build failure
.... many lines of output preced
:processDebugManifest
:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-update-manager/build-tools/24.0.2/aapt'' finished with non-zero exit value 1
<<< this is supposedly output from gradle >>>
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 13.708 secs
Error: Error code 1 for command: /usr/sources/mobile/.../platforms/android/gradlew with args: cdvBuildDebug,-b,/usr/sources/mobile/.../platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
... replace path for anonymisation
<<< is my own inserted line >>>
First off: are you using Tabris or Tabris.js? The former is a Java framework and is not compatible with Cordova. The latter is, but if you're trying to use Tabris.js as a slave to Cordova (i.e. using the Cordova build command) that's not going to work. Instead I suggest you convert your project structure Tabris.js's style and then run the build there. If you still encounter errors when after converting your structure and building with Tabris.js, post the full build log in the Tabris.js issue tracker.
I have a node project which I've imported into Visual Studio from Web Storm. The mocha tests run fine in Web Storm but in Visual Studio they don't run at all. I've set the test framework on the relevant files and the test discovery phase correctly locates them. When I run the tests they get a green tick even if I modify the system such that they must fail. If I click on the output for a test then I see the error:
NTVS_ERROR: Failed to find Mocha package. Mocha must be installed in
the project locally...
I have installed Mocha locally, uninstalled and re-installed but with no difference.
I've managed to get some more specific error information by editing the mocha.js file to print out what's going wrong. The problem occurs during the detectMocha function. The exception that I get in the log now is:
[Error: Cannot find module
'C:\projects\FastLaneVS"\node_modules\mocha'] code: 'MODULE_NOT_FOUND'
Now my assumption is that this extra double quote after my project directory is the problem. I've gone back to the run_tests.js and printed out the argv array to see where the project directory is coming from and indeed it's already appended by the time that function is called.
Now I'm happy to accept that I've done something and added this quote somewhere but I can't find it. I also don't understand why the find_tests should work since that calls the same method and passes the Project Directory in correctly.
In my project it's directory is listed just as . and I've checked both the sln and nsproj files in notepad++ to try and find a spurious double quote.
I'm using VS pro 2013 update 4 with node tools 1.0.21029.05
I could modify the mocha runner to trim a trailing double quote but any ideas on how I can correctly fix this would be great.
I'm playing around with the Cordova hooks capabilities and I'm trying to test using a node application as a hook. In this article: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ it references running node applications, so I know it's possible.
I've created a simple node application that I'm using to test the before prepare and after prepare process:
#! /usr/bin/env node
console.log("this is a node module");
When I run my prepare, I get the following error:
C:\Users\jwargo\dev\lunchmenu>cordova prepare
The system cannot find the path specified.
Hook failed with error code 1: C:\Users\jwargo\dev\lunchmenu\hooks\before_prepare\test.js
I can't find any information anywhere about what an error code of 1 means here.
I've tested the node code and it runs fine with "node test.js" and when I execute test.js from the command line Windows simply launches my default editor.
So, can anyone tell me what I'm doing wrong or what I need to do to be able to execute a node application as a hook with the Cordova CLI?
Figured it out with some help from the Cordova dev team. The space in my shebang was causing the problem. I removed it and the problem went away.
I am using Grunt in a custom deployment script for my Azure website. The Gruntfile is kind of big and it takes maybe two minutes to run. Everything was fine until a few days, the build just stops while running Grunt with a message: The application was terminated.
The weirdest thing about that, is that sometimes it works! So this is not an issue related to my Gruntfile.
This is how I call Grunt:
call node %DEPLOYMENT_SOURCE%\node_modules\grunt-cli\bin\grunt --no-color
Is it possible that it is a timeout issue or something like that?
I run jasmine tests in my node.js application via grunt. I've added grunt test to Webstorm's run configurations.
In "Run/Debug Configurations" the "Grunt Test" has following properties specified: node interpreter (node.exe in Program Files), working directory (project location), JavaScript file (grunt binary), and application parameters (test - grunt task name).
The configuration works correctly but stops without printing full jasmine output. Sometimes before printing any output, most often after some part of jasmine log, but before test summary or error details. Always the last line of output is
Process finished with exit code 0
When I take the Webstorm command and run it manually in console it works fine and always prints full output:
"C:\Program Files\nodejs\node.exe" C:\...\node_modules\grunt-cli\bin\grunt test
My tests includes asynchronous cases, so it takes about 20 seconds to run them all.
I noticed that each attempt to run tests via Webstorm prints a bit longer output. First attempt ends without any but after ten further I got full output with test summary.
Known issue, please see http://youtrack.jetbrains.com/issue/WEB-1926 and discussion on stackoverflow (mocha + webstorm - error message broken)
To fix the case described in question we can run jasmine tests directly by jasmine-node command (skipping grunt).
We have to set up new "Run/Debug Configuration" based on "Node.js" pre-conf.
Node interpreter (as usual):
C:\Program Files\nodejs\node.exe
Working directory: project root,
JavaScript file:
node_modules\grunt-jasmine-node\node_modules\jasmine-node\lib\jasmine-node\cli.js
This is for my case (using grunt-jasmine-node). We can also provide path to cli.js of jasmine-node installed globally.
Application variables:
--verbose src/test/js
Of course the last one is a path to directory of tests in my project. Here we can specify list of files or use other jasmine-node commands and parameters.
The problem that process.exit() does not wait the stdout. You should defer the exit call with one tick, that's all.