3
respostas

'npm start' esta dando erro

const path = require('path');
const babiliPlugin = require('babili-webpack-plugin');

let plugins = [];

if (process.env.NODE_ENV =='production'){

    plugins.push(new babiliPlugin())
};

module.exports={

    entry:'./app-src/app.js',
        output: {

            filename: 'bundle.js',
            path: path.resolve(__dirname, 'dist'),
            publicPath: 'dist'
        },


    module:{
        rules:[
                {
                test: /\.js$/,
                exclude: /node_modules/,

                use: {
                    loader: 'babel-loader'
                }    
            }

        ]


    },
    plugins

}
{
  "name": "client",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build-dev": "webpack --config webpack-config.js",
    "build-prod": "cross-env NODE_ENV=production webpack --config webpack-config.js",
    "start": "webpack-dev-server"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "reflect-metadata": "^0.1.10"
  },
  "devDependencies": {
    "babel-core": "^6.25.0",
    "babel-loader": "^7.1.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2017": "^6.24.1",
    "babili-webpack-plugin": "^0.1.1",
    "cross-env": "^5.0.1",
    "webpack": "^3.1.0",
    "webpack-dev-server": "^2.5.1"
  }
}
3 respostas

Oi, Arthur, tudo bem?

Qual a mensagem de erro que aparece no console do navegador? Para que posaa enetender melhor o que pode ter gerado esse erro.

Para 'build-dev' ou para o 'build-prod' esta funcionando certinho, mas para o 'start' esta dando esse erro todas as vezes.

No configuration file found and no entry configured via CLI option.
When using the CLI you need to provide at least two arguments: entry and output.
A configuration file could be named 'webpack.config.js' in the current directory.
Use --help to display the CLI options.
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! client@1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the client@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!     C:\Users\Ale\AppData\Roaming\npm-cache\_logs\2020-11-30T13_57_18_458Z-debug.log

Oi, Arthur!

Você poderia disponibilizar o teu projeto? como esse curso não tem projeto por aula, não consigo replicar exatamente o resultado que tens aí. Se puder, põe no github ou no googlo drive.

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