Code Monkey home page Code Monkey logo

Comments (13)

flagrede avatar flagrede commented on September 25, 2024 1

hi Jerome,

I'm not sure but i think it's related to the use of spawn, in the 'Gruntfile.js', on windows.
If you are on windows that might explain your problem.
Here the issue related to the problem on the node project: nodejs/node-v0.x-archive#2318
The issue is still opened though.

A solution would be to replace spawn by win-spawn:

  1. npm install win-spawn
  2. Replace the line in the Gruntfile.js:
    var spawn = require('child_process').spawn;
    by
    var spawn = require('win-spawn');

from generator-ionic.

mhartington avatar mhartington commented on September 25, 2024

What version of node do you have installed? Try updating your installed gems, and running brew update. I had some issues like this on other generators and it always came back to something needed to be updated on my end

from generator-ionic.

diegonetto avatar diegonetto commented on September 25, 2024

Jerome,

Can you give us some more information about what operating system you're on and what version of Node.js you're using?

I was unable to reproduce this issue, so if the above mentioned suggestions haven't resolved your problem, please let us know! Thanks.

from generator-ionic.

jeromerg avatar jeromerg commented on September 25, 2024

Issue was fixed with Flow11's tip:
var spawn = require('win-spawn');

I develop on windows 7 PC and node.js version is v0.10.25.

Thank you for the quick reply!

Jerome

from generator-ionic.

diegonetto avatar diegonetto commented on September 25, 2024

Re-opening this for now. I used spawn instead of exec because I wanted to stream the output of the Cordova commands, but it would be a good idea rewrite this in a way that is more portable.

from generator-ionic.

diegonetto avatar diegonetto commented on September 25, 2024

Looks like the root cause of this issue is that the main cordova command for Windows is a .cmd file and since spawn does not execute in a shell, only .exe files would run.

Great gist - https://gist.github.com/domenic/2790533#non-portable-apis

Even the official npm command has to incorporate some branching logic - https://github.com/npm/npm-www/blob/fd3a96e861989338676937736599598f7c0fde8f/dev/go.js#L22-27

I should have a fix for this shortly.

from generator-ionic.

pgruenbacher avatar pgruenbacher commented on September 25, 2024

I just got the exact same error even with the branch logic using the grunt build command. I'm using the win-spawn for now and it works

from generator-ionic.

diegonetto avatar diegonetto commented on September 25, 2024

@pgruenbacher are you still experiencing this issue on the latest version of generator-ionic ?

from generator-ionic.

pgruenbacher avatar pgruenbacher commented on September 25, 2024

@diegonetto just did a clean install, and grunt build returned no errors. looks good.

from generator-ionic.

denisazevedo avatar denisazevedo commented on September 25, 2024

Just an update, this issue still happens on Windows machines (Win7 for example) with all npm packages updated (including [email protected]).
Maybe a wiki page here could help new users. Thanks

from generator-ionic.

djett41 avatar djett41 commented on September 25, 2024

You can modify the spawn variable at the top of the Gruntfile to the follwing:
var spawn = process.platform === 'win32' ? require('win-spawn') : require('child_process').spawn;

This has a dependency on the win-spawn plugin which will need to be added to your package.json and installed.

from generator-ionic.

sriram-dev avatar sriram-dev commented on September 25, 2024

@djett41 That worked .. Thanks !

from generator-ionic.

irangausl avatar irangausl commented on September 25, 2024

Flow, Thank you very much. It worked for me.

from generator-ionic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.