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

Error: Cannot find module 'node-windows' #57

Closed
ardz opened this issue Jun 16, 2014 · 4 comments
Closed

Error: Cannot find module 'node-windows' #57

ardz opened this issue Jun 16, 2014 · 4 comments

Comments

@ardz
Copy link

ardz commented Jun 16, 2014

Sorry, not sure if this a bug maybe more a question, apologies in advance. I followed the instructions for installing via npm, but when I try and run anything I just get the following error:

module.js:340
throw err;
^
Error: Cannot find module 'node-windows'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (F:\REngine\tools\node\services.js:1:76)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10

have also tried adding the path's to windows env. vars, adding the node-windows module to the project folder - same error? any help appreciated

@coreybutler
Copy link
Owner

Did you do npm install -g node-windows? It should be installed globally.

This sounds like a path problem with your node/npm install.

@ardz
Copy link
Author

ardz commented Jun 17, 2014

Hi Corey, I'm not 100% sure I did that the first time I installed it, I did definitely do that when I re-installed it (I hadn't removed the previous install however, does that matter?)

Just did the following in cmd window:

path > c:\paths.txt

end of paths.txt shows:

C:\Program Files\nodejs;F:\Vagrant\bin;C:\Users\ardz\AppData\Roaming\npm

Update,

Also tried giving the full path to the module in the node script like so:

var wincmd = require('C:\Users\ardz\AppData\Roaming\npm\node_modules\node-windows');

Still throws the same error.

Update

Reinstated everything fresh to a completely new machine, did 'npm install -g node-windows' - same error. The machines are 64bit if that matters?

Thanks

@ardz ardz closed this as completed Jun 17, 2014
@ardz ardz reopened this Jun 17, 2014
@ardz
Copy link
Author

ardz commented Jun 17, 2014

This was entirely my error, I completely missed the step:

'npm link node-windows' in the project folder. Well I'm an idiot!

Thank you for this great module! :)

@ardz ardz closed this as completed Jun 17, 2014
@coreybutler
Copy link
Owner

No worries, glad you got it figured out!

Repository owner locked and limited conversation to collaborators Jun 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants