I want to start a simple local webserver for local development on Windows 7. For this I installed node.js and then ran:
npm install -g local-web-server
Next I went to the folder D:\[path_to_webcontent] containing the index.html, started a cmd-prompt from that folder and ran:
node ws
and get the error:
module.js:338
throw err;
^ Error: Cannot find module 'D:[path_to_webcontent]\ws'
Why can't node find the globally installed webserver?
The module "local-web-server" is located at C:\Users\<user>\AppData\Roaming\npm\node_modules.
Instead of node ws you just type wsin the cmd-prompt.
From the documentation on npm (https://www.npmjs.com/package/local-web-server):
$ npm install -g local-web-server
$ ws
When you write node ws node is looking to run a module called ws. When you want to use a globally installed package you just need to use the package's name in the cmd-prompt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With