title: SSD vs HDD as a performance factor in npm configuration: where to put .npm cache and node_modules directories to achieve best performance?
body: <p>Considering a dual-drive laptop with a 256GB SSD and 1TB HDD, where should one put their <code>.npm</code> cache and <code>node_modules</code> directories to achieve best performance?</p>
  
  <p>Any other advice warmly welcome.</p>
  
  <p>For your information:</p>
  
  <ul>
  <li>My whole <code>/home/username</code> partition is on the HDD.</li>
  <li>I use <code>nvm</code></li>
  <li>And here's the whole npm config (as extracted with <code>npm config ls -l</code> command):</li>
  </ul>
  
  <pre><code>; cli configs
  long = true
  metrics-registry = "https://registry.npmjs.org/"
  scope = ""
  user-agent = "npm/6.9.0 node/v10.15.3 linux x64"
  
  ; default values
  access = null
  allow-same-version = false
  also = null
  always-auth = false
  audit = true
  audit-level = "low"
  auth-type = "legacy"
  before = null
  bin-links = true
  browser = null
  ca = null
  cache = "/home/username/.npm"
  cache-lock-retries = 10
  cache-lock-stale = 60000
  cache-lock-wait = 10000
  cache-max = null
  cache-min = 10
  cafile = undefined
  cert = null
  cidr = null
  color = true
  commit-hooks = true
  depth = null
  description = true
  dev = false
  dry-run = false
  editor = "vi"
  engine-strict = false
  fetch-retries = 2
  fetch-retry-factor = 10
  fetch-retry-maxtimeout = 60000
  fetch-retry-mintimeout = 10000
  force = false
  git = "git"
  git-tag-version = true
  global = false
  global-style = false
  globalconfig = "/home/username/.nvm/versions/node/v10.15.3/etc/npmrc"
  globalignorefile = "/home/username/.nvm/versions/node/v10.15.3/etc/npmignore"
  group = 1001
  ham-it-up = false
  heading = "npm"
  https-proxy = null
  if-present = false
  ignore-prepublish = false
  ignore-scripts = false
  init-author-email = ""
  init-author-name = ""
  init-author-url = ""
  init-license = "ISC"
  init-module = "/home/username/.npm-init.js"
  init-version = "1.0.0"
  json = false
  key = null
  legacy-bundling = false
  link = false
  local-address = undefined
  loglevel = "notice"
  logs-max = 10
  ; long = false (overridden)
  maxsockets = 50
  message = "%s"
  ; metrics-registry = null (overridden)
  node-options = null
  node-version = "10.15.3"
  noproxy = null
  offline = false
  onload-script = null
  only = null
  optional = true
  otp = null
  package-lock = true
  package-lock-only = false
  parseable = false
  prefer-offline = false
  prefer-online = false
  prefix = "/home/username/.nvm/versions/node/v10.15.3"
  preid = ""
  production = false
  progress = true
  proxy = null
  read-only = false
  rebuild-bundle = true
  registry = "https://registry.npmjs.org/"
  rollback = true
  save = true
  save-bundle = false
  save-dev = false
  save-exact = false
  save-optional = false
  save-prefix = "^"
  save-prod = false
  scope = ""
  script-shell = null
  scripts-prepend-node-path = "warn-only"
  searchexclude = null
  searchlimit = 20
  searchopts = ""
  searchstaleness = 900
  send-metrics = false
  shell = "/bin/bash"
  shrinkwrap = true
  sign-git-commit = false
  sign-git-tag = false
  sso-poll-frequency = 500
  sso-type = "oauth"
  strict-ssl = true
  tag = "latest"
  tag-version-prefix = "v"
  timing = false
  tmp = "/tmp"
  umask = 18
  unicode = true
  unsafe-perm = true
  update-notifier = true
  usage = false
  user = 1001
  ; user-agent = "npm/{npm-version} node/{node-version} {platform} {arch}" (overridden)
  userconfig = "/home/username/.npmrc"
  version = false
  versions = false
  viewer = "man"
  </code></pre>