# Problem when trying to setup first VTKJS project

**URL:** https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761
**Category:** Web
**Created:** [December 1, 2020, 2:11pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761 "2020-12-01T14:11:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Rafael\_March](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rafael_march/32/2671_2.png) [@Rafael\_March](https://discourse.vtk.org/u/Rafael_March)
#### Post date: [December 1, 2020, 2:11pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/1 "2020-12-01T14:11:10Z")

</div>

Hello all,

my goal is to have a web app with a bootstrap-powered interface and an embedded VTKJS-based render view to visualize 3D volumes.

I’m trying to use node to build/start my first VTKJS project according to the following page:

> **[Using vtk.js as an ES dependency](https://kitware.github.io/vtk-js/docs/intro_vtk_as_es6_dependency.html)**
>
> This guide illustrates how to consume vtk.js as an ES dependency. This document was last updated with the following package versions: @kitware/vtk.js@v28 webpack@v5 Starting a new vtk.js projectTher

However, when trying to run the server ($npm start), the following error message appears:

$ npm start

> vtk-js-4@1.0.0 start C:\work\research\web-studies\vtk-js-4  
> webpack-dev-server --content-base ./dist

internal/modules/cjs/loader.js:883  
throw err;  
^

Error: Cannot find module ‘webpack-cli/bin/config-yargs’  
Require stack:

- C:\XXXXX\vtk-js-4\node\_modules\webpack-dev-server\bin\webpack-dev-server.js  
at Function.Module.\_resolveFilename (internal/modules/cjs/loader.js:880:15)  
at Function.Module.\_load (internal/modules/cjs/loader.js:725:27)  
at Module.require (internal/modules/cjs/loader.js:952:19)  
at require (internal/modules/cjs/helpers.js:88:18)  
at Object. (C:\work\research\web-studies\vtk-js-4\node\_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)  
at Module.\_compile (internal/modules/cjs/loader.js:1063:30)  
at Object.Module.\_extensions…js (internal/modules/cjs/loader.js:1092:10)  
at Module.load (internal/modules/cjs/loader.js:928:32)  
at Function.Module.\_load (internal/modules/cjs/loader.js:769:14)  
at Function.executeUserEntryPoint [as runMain] (internal/modules/run\_main.js:72:12) {  
code: ‘MODULE\_NOT\_FOUND’,  
requireStack: [  
‘C:\work\research\web-studies\vtk-js-4\node\_modules\webpack-dev-server\bin\webpack-dev-server.js’  
]  
}  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! vtk-js-4@1.0.0 start: `webpack-dev-server --content-base ./dist`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the vtk-js-4@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\XXXX\AppData\Roaming\npm-cache\_logs\2020-12-01T14\_09\_30\_514Z-debug.log

Anyone knows what might be wrong with my setup?

Thank you,  
Rafael March.

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [December 1, 2020, 5:33pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/2 "2020-12-01T17:33:23Z")

</div>

Hi, the latest version of vtk.js now uses webpack 5, and there were some changes regarding webpack dev server. If you replace `webpack-dev-server` with `webpack serve`, it should work.

---

<div class="post-metadata">

### Author: ![Rafael\_March](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rafael_march/32/2671_2.png) [@Rafael\_March](https://discourse.vtk.org/u/Rafael_March)
#### Post date: [December 1, 2020, 6:25pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/3 "2020-12-01T18:25:03Z")

</div>

Hi Forrest,

thanks for your reply. I tried

npm install webpack-serve

and I get the same error.

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [December 1, 2020, 6:26pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/4 "2020-12-01T18:26:18Z")

</div>

Hi, you should modify your `package.json` and replace `webpack-dev-server --content-base ./dist` with `webpack serve --content-base ./dist`.

---

<div class="post-metadata">

### Author: ![Rafael\_March](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rafael_march/32/2671_2.png) [@Rafael\_March](https://discourse.vtk.org/u/Rafael_March)
#### Post date: [December 1, 2020, 6:52pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/5 "2020-12-01T18:52:05Z")

</div>

It works now. Thank you very much, Forrest!

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [December 1, 2020, 7:17pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/6 "2020-12-01T19:17:39Z")

</div>

I’ll update the docs to reflect this change.

---

<div class="post-metadata">

### Author: ![davidshq](https://discourse.vtk.org/user_avatar/discourse.vtk.org/davidshq/32/3553_2.png) [@davidshq](https://discourse.vtk.org/u/davidshq)
#### Post date: [June 14, 2021, 8:46pm UTC](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761/7 "2021-06-14T20:46:06Z")

</div>

I ran into this same error regarding `webpack-cli/bin/config-yargs` following [Kitware’s video tutorial series](https://kitware.github.io/vtk-js/docs/tutorial.html) and the above steps seem to have resolved that error but caused another. I initially reported the entire issue here but have since broke it out into a new ticket:

> [@Error Using the Official vtk.js Tutorials (slides/video)](https://discourse.vtk.org/t/error-using-the-official-vtk-js-tutorials-slides-video/6003):
>
> I’ve run into some challenges following the [(official) video tutorial series on using VTK.js](https://kitware.github.io/vtk-js/docs/tutorial.html). I’m on [part 2](https://vimeo.com/375521036) and have built a project with the code provided. When I attempt to run npm run dev I receive an error about a missing webpack-cli/bin/config-yargs. I discovered a former thread in which this issue was discussed and resolved: [https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761](https://discourse.vtk.org/t/problem-when-trying-to-setup-first-vtkjs-project/4761) (You can look at the above thread to see the full error regarding config-yargs) I…

Hope this is helpful to others who experience the same errors.
