instalei o webpack com o comando npm install webpack -g
, porem quando tento usar o comando o webpack -h
ou outro qualquer da esse problema
> PS C:\Users\renan\Desktop\Wchat> webpack -h The CLI moved into a
> separate package: webpack-cli Would you like to install webpack-cli?
> (That will run npm install -D webpack-cli) (yes/NO)
Apos da yes , aparece o seguinte erro
PS C:\Users\renan\Desktop\Wchat> webpack -h
The CLI moved into a separate package: webpack-cli
Would you like to install webpack-cli? (That will run npm install -D webpack-cli) (yes/NO)yes
npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-prese
t-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ [email protected]
updated 1 package in 45.313s
{ Error: Cannot find module 'webpack-cli'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at runCommand.then.result (C:\Users\renan\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:62:14)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }
Com esse erro fico inutilizado de usar os comando webpack
, Alguem poderia me ajudar a resolver ?
Aqui esta o package.json
{
"name": "trabalhofinal",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"ejs": "^2.5.9",
"express": "^4.16.3",
"simple-peer": "^9.1.1"
},
"devDependencies": {
"webpack": "^4.6.0",
"webpack-cli": "^2.1.2",
"webpack-dev-server": "^2.7.1"
},
"description": ""
}
Apos ajeitar o comando webpack apareceu o seguinte erro ao tentar fazer um bundle.js
webpack ./src/app.js ./public/bundle.js
Hash: 0ad17ada6fbd759751dd
Version: webpack 4.6.0
Time: 629ms
Built at: 2018-05-01 01:45:09
1 asset
Entrypoint main = main.js
[0] ./src/app.js 23 bytes {0} [built]
[1] multi ./src/app.js ./public/bundle.js 40 bytes {0} [built]
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
ERROR in multi ./src/app.js ./public/bundle.js
Module not found: Error: Can't resolve './public/bundle.js' in 'C:\Users\renan\Desktop\TrabalhoFinal'
@ multi ./src/app.js ./public/bundle.js
PS C:\Users\renan\Desktop\TrabalhoFinal>
npm install -g pacote
e nãonpm install pacote -g
pode ser ai aonde esta o problemanpm uninstall -g webpack-cli
e instalar novamente:npm install -g webpack-cli