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

Fatal error when using on a windows machine #5

Open
phtrivier opened this issue Aug 5, 2014 · 3 comments
Open

Fatal error when using on a windows machine #5

phtrivier opened this issue Aug 5, 2014 · 3 comments

Comments

@phtrivier
Copy link

I managed to use "grunt link" to simplify linking many projects for the unix devs in my team, however
it fails under windows (yes, poor devs having to run on windows.)

They use "Git Bash" to execute shell commands.

$ grunt link --verbose --debug
Initializing
Command-line options: --verbose, --debug=1

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.

Registering "grunt-link" local Npm module tasks.
Reading c:\redacted\node_modules\grunt-link\package.json...OK
Parsing c:\redacted\node_modules\grunt-link\package.json...OK
Loading "link.js" tasks...OK
+ link
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
>> No tasks were registered or unregistered.

Running tasks: link

Running "link" task
[D] Task source: c:\redacted\node_modules\grunt-link\tasks\link.js

Cleaning modules
[D] Executing npm unlink some-module --global
Fatal error: ps process exited with code -1

It seems like the "npm unlink" command returns an exit code of "-1" when executed with the "exec" function from linker.js

I tried disabling the error code checks, and after that I get this error :

Fatal error: Already fired!

Any idea where this might come from ?

Thanks

@ruzz311
Copy link
Contributor

ruzz311 commented Aug 22, 2014

@phtrivier - exec uses require("child_process").spawn to execute some of the commands instead of using node's built in options which are better for cross-platform stability. I'm looking into changing this but if you want to take a stab and pull request before I can get to it, feel free!

@phtrivier
Copy link
Author

I think the command that causes the issue is "npm unlink" ; what would you mean by "node's built in options" in this case ? Is it possible to programmatically use npm commands ?

@ruzz311
Copy link
Contributor

ruzz311 commented Aug 24, 2014

@phtrivier - You can use npm programmatically: https://www.npmjs.org/doc/api/npm-commands.html

phtrivier added a commit to phtrivier/grunt-link that referenced this issue Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants