0

I am trying to run local host in my browser utilising Node Js..

Node Server function is not working.

I have switched from mac to windows.

Is there different functions for terminal and command prompt?

C:\Users\Alex\Desktop\deeplake4> node server
module.js:471
throw err;
^

Error: Cannot find module 'body-parser'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Alex\Desktop\deeplake4\server.js:5:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

C:\Users\Alex\Desktop\deeplake4>
2
  • 1
    npm install to install your dependencies Commented Aug 9, 2017 at 12:40
  • Thanks sorted! I cannot get console.log working. Would you know how to get this to respond? Commented Aug 9, 2017 at 12:46

2 Answers 2

1

try this npm i --save body-parser

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks sorted! I cannot get console.log working. Would you know how to get this to respond?
<!DOCTYPE html> <html> <head> <title>Deeplake</title> <script src='code.jquery.com/jquery-2.1.4.min.js'></script> <script src="./libs/jquery.min.js"></script> <script src="./libs/underscore-min.js"></script> </head> <body> <script> $.getJSON('articles.json', function(data) { console.log('it worked!'); }); </script> </body> </html>
Console in Chrome Dev Tools dose not seem to respond at all to my JQuery:
<script> $.getJSON('articles.json', function(data) { console.log('it worked!'); }); </script>
Console in Chrome Dev Tools dose not seem to respond at all to my JQuery: <script> $.getJSON('articles.json', function(data) { console.log('it worked!'); }); </script>
1
 npm i body-parser --save

Above command will save this dependency in package.json

1 Comment

Thanks Sorted Console in Chrome Dev Tools dose not seem to respond at all to my JQuery: <script> $.getJSON('articles.json', function(data) { console.log('it worked!'); }); </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.