title: Can't install bcrypt.ts on Visual Studio Code for a password hash function
body: <p>currently I am trying to implement a hash function based on npmjs's bcrypt guide:</p>
  
  <pre><code>var bcrypt = require('bcrypt.ts');
  
  // Sync - 10 rounds equal 10 hashes/sec
  const saltRounds = 10;
  const randomString = 'p4$$w0rD';
  
  // Hash Password
  var hash = bcrypt.hashSync(randomString, saltRounds);
  
  console.log(hash);
  </code></pre>
  
  <p>After multiple attempts to install the bcrypt module with "npm install bcrypt", every single time the following error appeared:</p>
  
  <pre><code>&gt; bcrypt@4.0.1 install C:\Users\Public\secrethash\node_modules\bcrypt
  &gt; node-pre-gyp install --fallback-to-build
  node-pre-gyp WARN Using needle for node-pre-gyp https download
  node-pre-gyp WARN Pre-built binaries not installable for bcrypt@4.0.1 and node@12.16.3 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
  node-pre-gyp WARN Hit error Remote end closed socket abruptly.
  </code></pre>
  
  <p>I already searched for this error online, however I didn't find a general fix or workaround. After quite some time I tried npm rebuilt, npm uninstall bcrypt (and reinstall it with npm install bcrypt), fixing multiple nody-gyp issues etc. After installing it globally and enabling all kinds of script execution however, the previous error still appeared, but somehow bcrypt must have been successfully installed:</p>
  
  <pre><code>PS C:\Users\Public\secrethash&gt; npm install bcrypt
  
  &gt; bcrypt@4.0.1 install C:\Users\Public\secrethash\node_modules\bcrypt
  &gt; node-pre-gyp install --fallback-to-build
  
  node-pre-gyp WARN Using needle for node-pre-gyp https download
  node-pre-gyp WARN Pre-built binaries not installable for bcrypt@4.0.1 and node@12.16.3 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
  node-pre-gyp WARN Hit error Remote end closed socket abruptly.
  Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
    nothing.vcxproj -&gt; C:\Users\Public\secrethash\node_modules\bcrypt\build\Release\\nothing.lib
    blowfish.cc
    bcrypt.cc
    bcrypt_node.cc
    win_delay_load_hook.cc
       Bibliothek "C:\Users\Public\secrethash\node_modules\bcrypt\build\Release\bcrypt_lib.lib" und O
    bjekt "C:\Users\Public\secrethash\node_modules\bcrypt\build\Release\bcrypt_lib.exp" werden erstel
    lt.
    bcrypt_lib.vcxproj -&gt; C:\Users\Public\secrethash\node_modules\bcrypt\build\Release\\bcrypt_lib.no
    de
    Copying C:\Users\Public\secrethash\node_modules\bcrypt\build\Release\/bcrypt_lib.node to C:/Users
    /Public/secrethash/node_modules/bcrypt/lib/binding/napi-v3\bcrypt_lib.node
            1 Datei(en) kopiert.
  npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Public\secrethash\package.json'npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Public\secrethash\package.json'
  npm WARN secrethash No description
  npm WARN secrethash No repository field.
  npm WARN secrethash No README data
  npm WARN secrethash No license field.
  
  + bcrypt@4.0.1
  updated 1 package and audited 441 packages in 11.015s
  
  1 package is looking for funding
    run `npm fund` for details
  
  found 0 vulnerabilities
  </code></pre>
  
  <p>Right now, I can find a bcrypt folder in the node_modules folder of the project, however (and this is where my question actually takes place), when executing the typescript function via tsc and node, bycrypt.ts as a module cannot be found:</p>
  
  <pre><code>Error: Cannot find module 'bcrypt.ts'
  Require stack:
  - C:\Users\Public\secrethash\secret_hash.js
  ?[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)?[39m
  ?[90m    at Function.Module._load (internal/modules/cjs/loader.js:840:27)?[39m
  ?[90m    at Module.require (internal/modules/cjs/loader.js:1019:19)?[39m
  ?[90m    at require (internal/modules/cjs/helpers.js:77:18)?[39m
      at Object.&lt;anonymous&gt; (C:\Users\Public\secrethash\secret_hash.js:1:14)
  ?[90m    at Module._compile (internal/modules/cjs/loader.js:1133:30)?[39m
  ?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)?[39m
  ?[90m    at Module.load (internal/modules/cjs/loader.js:977:32)?[39m
  ?[90m    at Function.Module._load (internal/modules/cjs/loader.js:877:14)?[39m
  ?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)?[39m {
    code: ?[32m'MODULE_NOT_FOUND'?[39m,
    requireStack: [ ?[32m'C:\\Users\\Public\\secrethash\\secret_hash.js'?[39m ]
  }
  </code></pre>
  
  <p>Therefore I would like to ask whether anyone of you could explain why the module still cannot be found? Maybe I'm on a completely wrong track when it comes to module storing and working directories at all (first time working with VS code and node.js/npm/typescript). Due to this, I also uploaded the folder structure to prevent any kind of misunderstandings in which directory the modules have to be placed. If you need more information, I'm happy to share further error code examples. </p>
  
  <p>Best and thanks!</p>
  
  <p><a href="https://i.stack.imgur.com/53TUK.png" rel="nofollow noreferrer">Depository Folder Upper</a></p>
  
  <p><a href="https://i.stack.imgur.com/agO7S.png" rel="nofollow noreferrer">Depository Folder Lower</a></p>