title: Node can't find module but it exists in node_modules?
body: <p>I've been playing with node for the past day and I've run into an issue I would really appreciate help on. </p>
  
  <p>I created a new project and am trying to use a module I installed using npm, the module exists in the node_modules directory as expected and the command ran without error but node is unable to find it and throws an error (I have tried multiple packages with the same result). Below explains what I have done:</p>
  
  <p>I created a new project using <code>npm init</code> and completed the guided <code>package.json</code> creation. I then created a javascript file containing this line of code. </p>
  
  <p><code>const k = require('korbit-node');</code></p>
  
  <p>and installed the module using <code>npm install korbit-node</code> then tried to run it locally using <code>node index.js</code> (what i called the js file) and was given this error. </p>
  
  <pre><code>$ node index.js
  
  module.js:472
      throw err;
      ^
  
  Error: Cannot find module 'korbit-node'
      at Function.Module._resolveFilename (module.js:470:15)
      at Function.Module._load (module.js:418:25)
      at Module.require (module.js:498:17)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (/Users/gabe/Desktop/js_sandbox/index.js:1:73)
      at Module._compile (module.js:571:32)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:488:32)
      at tryModuleLoad (module.js:447:12)
      at Function.Module._load (module.js:439:3)
  </code></pre>
  
  <p>To me this seems to be a fairly straight-forward error message telling me that the package isn't installed. However my project structure looks like this:</p>
  
  <pre><code>├── index.js
  ├── node_modules
  │   ├── debug
  │   │   ├── CHANGELOG.md
  │   │   ├── LICENSE
  │   │   ├── Makefile
  │   │   ├── README.md
  │   │   ├── component.json
  │   │   ├── karma.conf.js
  │   │   ├── node.js
  │   │   ├── package.json
  │   │   └── src
  │   │       ├── browser.js
  │   │       ├── debug.js
  │   │       ├── index.js
  │   │       └── node.js
  │   ├── iconv-lite
  │   │   ├── Changelog.md
  │   │   ├── LICENSE
  │   │   ├── README.md
  │   │   ├── encodings
  │   │   │   ├── dbcs-codec.js
  │   │   │   ├── dbcs-data.js
  │   │   │   ├── index.js
  │   │   │   ├── internal.js
  │   │   │   ├── sbcs-codec.js
  │   │   │   ├── sbcs-data-generated.js
  │   │   │   ├── sbcs-data.js
  │   │   │   ├── tables
  │   │   │   │   ├── big5-added.json
  │   │   │   │   ├── cp936.json
  │   │   │   │   ├── cp949.json
  │   │   │   │   ├── cp950.json
  │   │   │   │   ├── eucjp.json
  │   │   │   │   ├── gb18030-ranges.json
  │   │   │   │   ├── gbk-added.json
  │   │   │   │   └── shiftjis.json
  │   │   │   ├── utf16.js
  │   │   │   └── utf7.js
  │   │   ├── lib
  │   │   │   ├── bom-handling.js
  │   │   │   ├── extend-node.js
  │   │   │   ├── index.d.ts
  │   │   │   ├── index.js
  │   │   │   └── streams.js
  │   │   └── package.json
  │   ├── korbit-node
  │   │   ├── README.md
  │   │   ├── korbit.js
  │   │   └── package.json
  │   ├── lodash
  │   │   ├── README.md
  │   │   ├── dist
  │   │   │   ├── lodash.compat.js
  │   │   │   ├── lodash.compat.min.js
  │   │   │   ├── lodash.js
  │   │   │   ├── lodash.legacy.js
  │   │   │   ├── lodash.legacy.min.js
  │   │   │   ├── lodash.min.js
  │   │   │   ├── lodash.mobile.js
  │   │   │   ├── lodash.mobile.min.js
  │   │   │   ├── lodash.underscore.js
  │   │   │   └── lodash.underscore.min.js
  │   │   ├── lodash.js
  │   │   └── package.json
  │   ├── ms
  │   │   ├── index.js
  │   │   ├── license.md
  │   │   ├── package.json
  │   │   └── readme.md
  │   └── needle
  │       ├── README.md
  │       ├── bin
  │       │   └── needle
  │       ├── examples
  │       │   ├── deflated-stream.js
  │       │   ├── digest-auth.js
  │       │   ├── download-to-file.js
  │       │   ├── multipart-stream.js
  │       │   ├── parsed-stream.js
  │       │   ├── parsed-stream2.js
  │       │   ├── stream-events.js
  │       │   ├── stream-to-file.js
  │       │   └── upload-image.js
  │       ├── lib
  │       │   ├── auth.js
  │       │   ├── cookies.js
  │       │   ├── decoder.js
  │       │   ├── multipart.js
  │       │   ├── needle.js
  │       │   ├── parsers.js
  │       │   └── querystring.js
  │       ├── package.json
  │       └── test
  │           ├── basic_auth_spec.js
  │           ├── compression_spec.js
  │           ├── cookies_spec.js
  │           ├── decoder_spec.js
  │           ├── errors_spec.js
  │           ├── helpers.js
  │           ├── keys
  │           │   ├── ssl.cert
  │           │   └── ssl.key
  │           ├── parsing_spec.js
  │           ├── proxy_spec.js
  │           ├── querystring_spec.js
  │           ├── redirect_spec.js
  │           ├── stream_spec.js
  │           ├── url_spec.js
  │           └── utils
  │               ├── formidable.js
  │               ├── proxy.js
  │               └── test.js
  └── package.json
  </code></pre>
  
  <p>and I can clearly see the module in the node_modules file so I am unsure why it isn't being found. </p>
  
  <p>I've seen these questions <a href="https://stackoverflow.com/questions/20185627/node-js-node-path-environment-variable">Node.js NODE_PATH environment variable</a>
  about making sure the <code>NODE_PATH</code> is set properly but I found that even after I explicitly pointed the path to the file it still did not work. I also of course found questions about the package not being installed but that is not the case in this situation. </p>
  
  <p>Could someone please tell me why this isn't being found by node or point me to some resources about this issue/how node handles packages? I'm sure its a simple issue but everything I have found online/in the documentation has been unhelpful so far. </p>