Skip to content

webpack-cli init doesn't install webpack, uglifyjs-webpack-plugin, babel-preset-es2015 #135

Description

@nilliams

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

$ webpack-cli init

Insecure about some of the questions?

https://github.com/webpack/webpack-cli/blob/master/INIT.md

? Will you be creating multiple bundles? No
? Which module will be the first to enter the application? index.js
? Which folder will your generated bundles be in? [default: dist]:
? Are you going to use this in production? No
? Will you be using ES2015? Yes
? Will you use one of the below CSS solutions? No
? If you want to bundle your CSS files, what will you name the bundle? (press enter to skip)
? Name your 'webpack.[name].js?' [default: 'config']:
...
├─┬ babel-core@6.24.1
│ ├─┬ babel-code-frame@6.22.0
│ │ ├─┬ chalk@1.1.3
...
└── UNMET PEER DEPENDENCY webpack@2

Then:

$ webpack-cli
module.js:471
    throw err;
    ^

Error: Cannot find module 'webpack'

If install webpack (npm i -S webpack), next error is:

$ webpack-cli
module.js:471
    throw err;
    ^

Error: Cannot find module 'uglifyjs-webpack-plugin'

If install that, we get (after fixing "./dist" is not an absolute path which is I see is fixed now):

$ webpack-cli
Hash: 5492c18c1852ed5bd45b
Version: webpack 2.5.1
Time: 3144ms
         Asset     Size  Chunks             Chunk Names
main.bundle.js  1.99 kB       0  [emitted]  main
   [0] ./index.js 1.49 kB {0} [built] [failed] [1 error]

ERROR in ./index.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory

What is the expected behavior?

webpack-cli init to install all needed deps

Version

$ webpack-cli --version
1.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions