Hi, I’m trying to build the latest github code of Visualizer on Ubuntu 18.04, following the guidline at: https://github.com/Kitware/visualizer.
- After I git clone the code to local path, I copy it to the directory of /data/visualizer
- I give the read/write/modify rights of /data to all account using “sudo chmod -R 777 /data”
- I go into visualizer directory
- sudo npm install
But I come across the problem as follows:
I have try to google, and try some solution, such as:
- install node-gyp, python, make, gcc
- modify the default path of npm
- modify the rights of ~/.npm path
But all failed.
Can anyone help me? Thank you~
Are you trying to build it because you want to expand the code or just use it?
If it is just to use it, you just need the ./dist/ directory and the ./server/ ones. It is already built.
Regarding your issue, it is specific to node and some of our dependency for testing. Depending on your usage, you can remove those dependencies.
Let me know what’s your goal behind that.
Thank you. We want to expand it and develop our specific app of web visualization
I’ve just noticed that you are doing
sudo npm install. You should never do
sudo when you do a
npm install in a project. I can’t tell if that’s your issue, but you don’t want to mixup permission inside your repo/project.
I still have problem.
I user Ubuntu 18.04 LTS and login with administrative account steven.
My node version and npm version is as following snapshot
I want to know whether this problem is related with the user account or the dir path?
pkg-config: not found
Try to install it? Did you install
build-essential so you could build and compile applications on your system?
I just follow the website: https://github.com/kitware/visualizer
So I did not find the build-essential section in the user guid. Where is it ?
I almost come to success. Summery as follows:
install node and npm:
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm install npm@latest -g
sudo npm install -g n
sudo n stable
install other essential package:
sudo apt-get install build-essential pkg-config libcairo2-dev libjpeg-dev libgif-dev
So my problem is the lack of the other essential package in my Ubuntu system, which is not shown in the guidline.
The document assume you have a machine setup for development. We don’t go into details on how to install a computer.
What is happening is that one of the dependency needs to compile some code (C++) and on linux to do so you need a bunch of tools such as a compiler, build tools and so on.
The Linux distribution simplify the process by providing a meta package with that set of tools. To install on your system those build tools, you should be able to run the following command line:
sudo apt-get install build-essential
What is the error now?
Because so far the issue were:
- permission issue as you ran the install command as sudo
- you were missing
So now, if you have pkg-config, there is no reason to get the same error?
After I install those package, no errors prompt.
But only one issue is that the “npm link” command should add sudo.
npm link is not required for development. It is only needed if you use the
Visualizer executable which helps to generate the appropriate command line.
All the npm issue you are facing are computer specific and are dependent on the way you’ve installed node.
So could you tell me the best way of installing node and npm for Visualizer development ?
A google search lead me to this blog which seems to do the trick.
Excuse me, how do you edit and code the .mcss style file?
I guess you code it in some visualization IDE?
It is css (module), so a plain text editor should do fine.
I am trying to compile the source code in webpack enviroment.
For automated compile and see the webpage, I install the webpack-dev-server first.
Then go to the visualizer directory, I run “npm run dev”, but the webpage is empty, just the title come out.
So where is the problem? thanks!
Where is the ParaView server? You need to run the server
$ pvpython ./server/pvw-visualizer.py --content ./dist --data ~/ --port 8080
Then you can incrementally build the web app with the following command line
$ npm run build -- --watch
I have try your way, and it works. Thank you~
BTY, I find that this way is just used for coding and debug at the same time.
Is there anyway that I can see the realtime change of webpage when coding?
I’m pretty sure you can, but keep in mind that you have a stateful server side connected via websocket.
You can probably use the webpack-dev-server as long your properly configure the proxy for the websocket.