Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

Erro ao copilar o código: Module not found: Error: Can't resolve 'jquery'

Escrevi o código certinho, mas recebi esse erro no terminal e não sei o porquê. Alguém poderia me ajudar?

ERROR in multi jquery bootstrap reflect-metadata
Module not found: Error: Can't resolve 'jquery' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client'
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/modal.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/modal.js 1:0-32
 @ ./app-src/app.js

ERROR in ./node_modules/bootstrap/js/transition.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/transition.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/alert.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/alert.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/button.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/button.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/collapse.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/collapse.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/dropdown.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/dropdown.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/popover.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/popover.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/scrollspy.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/scrollspy.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/tab.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/tab.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/carousel.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/carousel.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/affix.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/affix.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

ERROR in ./node_modules/bootstrap/js/tooltip.js
Module not found: Error: Can't resolve 'jquery/dist/jquery.js' in 'C:\Users\Amanda\Documents\Alura\20 Webpack\Projeto Webpack\client\node_modules\bootstrap\js'
 @ ./node_modules/bootstrap/js/tooltip.js 1:0-32
 @ ./node_modules/bootstrap/dist/js/npm.js
 @ multi jquery bootstrap reflect-metadata

Link para o meu código completo:

https://gist.github.com/amandavitoriaav/84396804d99dcd54605cd5b9aeb3e56a

5 respostas

Oi Amanda tudo bem?

Precisava que você colocasse , por gentileza, toda a pasta do seu projeto (menos o node-modules) no github (não no gist, o github normal mesmo). Assim poderemos analisar melhor e ver o que está acontecendo.

Coloquei todo o arquivo nesse link do git:

https://github.com/amandavitoriaav/curso-alura/blob/master/Projeto%20Webpack.zip

solução!

Amanda, na pasta client execute o comando

npm install jquery --save

assim ele irá instalar o jquery que o npm tava reclamando que não existia.

Espero ter ajudado!!!

Obrigada pela ajuda André, era isso mesmo que faltava, o problema foi resolvido!!! :)

Disponha e bons estudos!!!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software