1

I ran these commands to make the directory:

mkdir webpack-demo
cd webpack-demo
npm init -y
npm install webpack --save-dev
npm install webpack-cli --save-dev

and then type cd webpack-demo, then if I type ls I get "node_modules" "package-lock.json" "package.json"

but then when I attempt to follow the next instructions from the webpack basic set up instruction page:

  webpack-demo
 |- package.json
+ |- index.html
+ |- /src
+ |- index.js

I get the following output from terminal:

|- package.json
-bash: syntax error near unexpected token `|'
+ |- index.html
-bash: +: command not found
-bash: -: command not found
+ |- /src
-bash: +: command not found
-bash: +: command not found
+   |- index.js
-bash: +: command not found
-bash: -: command not found

What am I doing wrong?

1
  • 2
    Those aren't commands, it's a diagram of the directory tree you're creating. Aug 5, 2019 at 3:08

1 Answer 1

2

The instructions use the same formatting for commands you need to enter and for output, which is confusing. Just use mkdir to create any missing directories.

PS: It seems as if the directory structure within webpack-demo is created automatically by the various commands you run (or are supposed to run), so you may not even need to create additional directories yourself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .