title: Solidity: ParserError: Expected pragma, import directive or contract /interface/library definition
body: <p>I am getting error with both latest solc (0.5.2 version) and 0.4.25 too while I am writing Simple contract</p>
  
  <p>I have tried following steps</p>
  
  <ol>
  <li>uninstalled Solc: npm uninstall solc </li>
  <li>Installed targeted version: npm install --save solc@0.4.25</li>
  <li><p>node compile.js (code given below)</p>
  
  <pre><code>  { contracts: {},
    errors:
     [ ':1:1: ParserError: Expected pragma, import directive or contract
   /interface/library definition.\nD:\\RND\\BlockChain\\contracts\\Inbox.sol\n^\n' ],sourceList: [ '' ],sources: {} }
  </code></pre></li>
  </ol>
  
  <p><strong>Compile.js</strong></p>
  
  <pre><code>const path  = require('path');
  const fs = require('fs');
  const solc = require('solc');
  const inPath = path.resolve(__dirname,'contracts','Inbox.sol');
  const src =  fs.readFileSync(inPath,'UTF-8');
  const res = solc.compile(inPath, 1);
  
  console.log(res);
  </code></pre>
  
  <p><strong>Inbox.sol</strong></p>
  
  <pre><code>pragma solidity ^0.4.25;
  
  contract Inbox {
      string  message;
  
  
      function Inbox(string passedName) public {
          message = passedName;
      } 
  
      function setMessage(string newMsg) public {
          message = newMsg;
      }
  
      function getMessage() public view returns(string){
          return message;
      }
  }
  </code></pre>
  
  <p><strong><em>Code worked well on Remix</em></strong>, for version 0.5.2 I have added memory tag to make it compile on Remix. </p>
  
  <pre><code>ex:   function setMessage(string **memory** newMsg) 
  </code></pre>