javascript - Cannot find module 'node-static' -


i trying run samples regarding webrtc. went

https://bitbucket.org/webrtc/codelab/src/50a47bb092483fd7ca27998a365dff434919bf89?at=master

at step 5 needed run server.js. opened windows command prompt , entered:

c:\program files\nodejs>node d:\gitprojects\codelab\complete\step5\server.js

but got error:

module.js:338     throw err;           ^ error: cannot find module 'node-static'     @ function.module._resolvefilename (module.js:336:15)     @ function.module._load (module.js:278:25)     @ module.require (module.js:365:17)     @ require (module.js:384:17)     @ object.<anonymous> (d:\gitprojects\codelab\complete\step5\server.js:1:76)      @ module._compile (module.js:460:26)     @ object.module._extensions..js (module.js:478:10)     @ module.load (module.js:355:32)     @ function.module._load (module.js:310:12)     @ function.module.runmain (module.js:501:10) 

i have installed node-static module , present @

"c:\program files\nodejs\node_modules\node-static"

enter image description here

still getting error "cannot find module 'node-static'".

environmental "path" variable set "c:\users\user\appdata\roaming\npm"

i can see node-static folder present @ "c:\users\user\appdata\roaming\npm\node_modules\node-static" path too.

edit:

based on comments tried on windows command prompt install node-static:

c:\program files\nodejs>npm install node-static -g

i got output:

c:\users\user\appdata\roaming\npm\static -> c:\users\user\appdata\roaming\np m\node_modules\node-static\bin\cli.js node-static@0.7.6 c:\users\user\appdata\roaming\npm\node_modules\node-static ├── mime@1.3.4 ├── colors@1.1.2 └── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10) 

can me location cause of issue?

node_static not inbuilt nodejs module there should folder node_modules in doc root folder(step5) module in or create package.json , list dependency run npm install before node server.js


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -