2
respostas

ERRO PERMISSÃO

docker run -p 8080:3000 -v "$(pwd):/usr/src/app" -w "/usr/src/app" node npm start Error: EACCES: permission denied, scandir '/usr/src/app' (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18) at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20 at cb (/usr/local/lib/node_modules/npm/lib/npm.js:228:22) at /usr/local/lib/node_modules/npm/lib/npm.js:266:24 at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7 at Array.forEach () at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13 at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25) at /usr/local/lib/node_modules/npm/lib/config/core.js:112:20

2 respostas

Oi Alisson,

o npm está reclamando que não tem permissão pra rodar alguma coisa na pasta /usr. Se mudar a permissão da pasta antes de rodar o npm, isso daria certo. Se não quiser adicionar mais um comando além donpm start, tente mudar pra alguma outra pasta, porexemplo:/var/www`. Essa pasta já vem todas as permissões certinhas para rodar a aplicação

docker run -p 8080:3000 -v "$(pwd):/var/www" -w "/var/www" node npm start Error: EACCES: permission denied, scandir '/var/www' (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18) at /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20 at cb (/usr/local/lib/node_modules/npm/lib/npm.js:228:22) at /usr/local/lib/node_modules/npm/lib/npm.js:266:24 at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7 at Array.forEach () at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13 at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25) at /usr/local/lib/node_modules/npm/lib/config/core.js:112:20 (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. TypeError: Cannot read property 'loaded' of undefined at process. (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:40:18) at process.emit (events.js:182:13) /usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205 if (npm.config.get('json')) {