1
resposta

[Dúvida] Erro no comando "npm run build"

Ao rodar o comando npm run build apresenta o seguinte erro: francisco@quasar:/mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04$ npm run build

adopet@0.1.0 build /mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04 react-app-rewired build

module.js:549 throw err; ^

Error: Cannot find module 'source-map-loader' at Function.Module._resolveFilename (module.js:547:15) at Function.resolve (internal/module.js:18:19) at Object.override [as webpack] (/mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04/config-overrides.js:26:21) at require.cache.(anonymous function).exports.isWebpackFactory (/mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04/node_modules/react-app-rewired/overrides/webpack.js:18:23) at Object. (/mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04/node_modules/react-scripts/scripts/build.js:63:16) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (/mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04/node_modules/react-app-rewired/scripts/build.js:12:1) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32)

npm ERR! Linux 5.15.146.1-microsoft-standard-WSL2 npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! adopet@0.1.0 build: react-app-rewired build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the adopet@0.1.0 build script 'react-app-rewired build'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the adopet package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! react-app-rewired build npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs adopet npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls adopet npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /mnt/c/Users/DELL/Documents/Cursos/Alura/Scripting_Bash_Docker/aula-04/npm-debug.log

1 resposta

## Isso normalmente ocorre quando o módulo necessário não está instalado ou não foi corretamente adicionado às dependências do projeto
## 
# tente esses passos:
# 
# 1) executar npm install source-map-loader --save-dev
# 2) verifique se o módulo foi adicionado corretamente na seção de dependências de desenvolvimento (devDependencies) no arquivo package.json.
# 3) Após a instalação do módulo, tente rodar o processo de build novamente para ver se o erro foi resolvido.
# 4)  npm cache clean --force
# 5)  npm install
# 6)  npm install -g npm-check