Ao criar o volume ele apresenta o erro. Estou utilizando o docker no Linux Ubuntu.
waldir@ubuntuserver:~$ docker run -p 8080:3000 -v "/home/waldir/volume-exemplo:/var/www" -w "/var/www" node npm start
> volume-exemplo@1.0.0 start /var/www
> node .
internal/modules/cjs/loader.js:896
throw err;
^
Error: Cannot find module './lib/express'
Require stack:
- /var/www/node_modules/express/index.js
- /var/www/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:893:15)
at Function.Module._load (internal/modules/cjs/loader.js:743:27)
at Module.require (internal/modules/cjs/loader.js:965:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/var/www/node_modules/express/index.js:11:18)
at Module._compile (internal/modules/cjs/loader.js:1076:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:941:32)
at Function.Module._load (internal/modules/cjs/loader.js:782:14)
at Module.require (internal/modules/cjs/loader.js:965:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/var/www/node_modules/express/index.js', '/var/www/index.js' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! volume-exemplo@1.0.0 start: `node .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the volume-exemplo@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-09-22T19_24_24_481Z-debug.log