title: How to use npm with docker in Laravel?
body: <p>I am using a docker setup like <a href="https://github.com/aschmelyun/docker-compose-laravel" rel="nofollow noreferrer">here</a> for Laravel.</p>
  <p>In my <code>docker-compose.yml</code> I have my own npm service:</p>
  <pre><code>npm:
      image: node:14.6
      container_name: npm-memberportali
      volumes:
        - .:/var/www
      working_dir: /var/www
      entrypoint: ['npm']
      networks:
        - lahmi
  </code></pre>
  <p>Calling <code>docker-compose run --rm npm install</code> works fine. However, calling
  <code>docker-compose run --rm npm run dev</code> fails with:</p>
  <pre><code>Error: Cannot find module '../lib/utils/unsupported.js'
  
  Require stack:
  - /var/www/node_modules/.bin/npm
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
      at Function.Module._load (internal/modules/cjs/loader.js:911:27)
      at Module.require (internal/modules/cjs/loader.js:1125:19)
      at require (internal/modules/cjs/helpers.js:75:18)
      at /var/www/node_modules/.bin/npm:19:21
      at Object.&lt;anonymous&gt; (/var/www/node_modules/.bin/npm:153:3)
      at Module._compile (internal/modules/cjs/loader.js:1236:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
      at Module.load (internal/modules/cjs/loader.js:1085:32)
      at Function.Module._load (internal/modules/cjs/loader.js:950:14) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/var/www/node_modules/.bin/npm' ]
  }
  </code></pre>
  <p>I am using this docker setup for multiple Laravel projects and so far it always worked. Any clues why it fails here?</p>