Yarn #299
-
Is anyone using this module with yarn? I recently had to do some troubleshooting which involved wiping out my node_modules and daemon folders to start fresh (I made the mistake of not uninstalling the service first which was a bit of headache). Now I can't get the module to reliably start/stop in my deploy script. I ran I almost feel like I need to link node-windows every time too, but this could just be happenstance. If I stop/start, sometimes I get "Error: cannot find module "node-windows"". Then I have to link to get it to recognize node-windows again, at which point it can't find the service it just stopped and I have to reinstall again, which it will happily do and start up. As you can imagine, this process is not very deploy script friendly and frustrating. Something tells me this has more to do with yarn and npm fighting. Annoyingly enough, yarn doesn't have a global install option like npm anymore so that sucks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This library wasn't written with yarn in mind, but I know there are users who successfully use it with yarn. I can't think of anything npm-specific in the code base. This issue may be due to the use of In case it's helpful, the wiki has several answers/comments about using |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick response! I'll look into that and see if that's maybe to do with it. My only concern is we've been using this build script for quite some time now and if all it took to break it was resetting the node_modules... |
Beta Was this translation helpful? Give feedback.
This library wasn't written with yarn in mind, but I know there are users who successfully use it with yarn. I can't think of anything npm-specific in the code base.
This issue may be due to the use of
__dirname
though... if you're actually using that variable to define a path. When the application runs,__dirname
refers to the root of the current application. If I correctly understand your setup, this would be the node-windows directory, not a code directory. I recommend hard-coding paths to test whether your deploy script is properly generating the appropriate paths.In case it's helpful, the wiki has several answers/comments about using
__dirname
.