node can't find modules that exists in parent node_modules folder

I am using node 0.12.0 with express and created a Docker image.
This is my directory structure:

-server/
    -config/
        -config.js
    -app.js
    -package.json
    -node-modules/
        -deep-extend/
            -...
            -...
            -...

My package.json looks like:

  • Docker within PCF - unable to connect to rabbitmq via AMQP (spring cloud bus)
  • Logging from one docker container to another
  • A different VM with name panamax-vm has been created already
  • Docker container with entrypoint variable expansion and CMD parameters
  • Docker: Jenkins container can't access internet on QNAP device
  • How to use data in a docker container?
  • {
      "name": "test",
      "version": "2.0.0",
      "private": true,
      "dependencies": {
        ...
        ...
        "deep-extend": "^0.3.2",
        ...
        ...
      }
    }
    

    and config/config.js looks like:

    var deepExtend = require('deep-extend');
    ...
    ...
    ...
    module.exports = deepExtend({}, .....);
    

    I have an issue running this app. When running it with node server/app I got and error:

    Error: Cannot find module 'deep-extend'
    

    When running the following, the problem solved and node server/app runs fine:

    cd config
    npm install deep-extend
    

    When is the problem?
    Why node doesn’t look on parent folder for node_modules?

  • Using mysql image from docker
  • Connection refused by Docker container
  • Redirect python print output to graylog2
  • wordpress container cannot connect to mariadb container
  • Elastic search not working as expected
  • Docker global variable unavailable in Jenkins pipeline
  • One Solution collect form web for “node can't find modules that exists in parent node_modules folder”

    In order to solve this I had to add the node_modules folder into my NODE_PATH environment variable.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.