Kitware / visualizer

The ParaViewWeb Visualizer application which can be used standalone or as a component within another web context.
https://kitware.github.io/visualizer/
BSD 3-Clause "New" or "Revised" License
115 stars 28 forks source link

command "npm run build" failed #38

Closed wgui1 closed 7 years ago

wgui1 commented 7 years ago

I tried to follow the README to do npm run build, but I met error soon.

paraview@ubuntu-16-paraview:~/visualizer$ npm run build

> pvw-visualizer@0.0.0-semantically-release build /home/paraview/visualizer
> fix-autobahn && webpack

sh: 1: webpack: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! pvw-visualizer@0.0.0-semantically-release build: `fix-autobahn && webpack`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pvw-visualizer@0.0.0-semantically-release build 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!     /home/paraview/.npm/_logs/2017-08-16T09_45_31_948Z-debug.log

Then, I update package.json and add following modules

    "webpack": "1.14.0",
    "babel-preset-es2015": "6.9.0",
    "babel-preset-react": "6.22.0"

I met error related with webpack

> fix-autobahn && webpack

Hash: 35b184ce2e4d48472af0
Version: webpack 1.14.0
Time: 6523ms
                                 Asset     Size  Chunks             Chunk Names
  25a32416abee198dd821b0b17a198a8f.eot  76.5 kB          [emitted]
e6cf7c6ec7c2d6f670ae9d762604cb0b.woff2  71.9 kB          [emitted]
 c8ddf1e5e5bf3682bc7bebf30f394148.woff  90.4 kB          [emitted]
  1dc35d25e61d819a9c357074014867ab.ttf   153 kB          [emitted]
  d7c639084f684d66a1bc66855d193ed8.svg   392 kB          [emitted]
                         Visualizer.js  1.93 MB       0  [emitted]  main
    + 285 hidden modules

ERROR in ./~/_paraviewweb@2.5.0@paraviewweb/src/React/Renderers/VtkRenderer/index.js
Module parse failed: /home/paraview/visualizer/node_modules/_paraviewweb@2.5.0@paraviewweb/src/React/Renderers/VtkRenderer/index.js Unexpected token (107:11)
paraview@ubuntu-16-paraview:~/visualizer$ npm version
{ 'pvw-visualizer': '0.0.0-semantically-release',
  npm: '5.3.0',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '58.2',
  modules: '48',
  node: '6.11.2',
  openssl: '1.0.2l',
  uv: '1.11.0',
  v8: '5.1.281.103',
  zlib: '1.2.11' }

I intended to fix --proxies problem as mentioned in https://github.com/Kitware/visualizer/issues/35 , but it seems I blocked by setup dev environment.

Is there a document that I can follow to have good "npm run build'

jourdain commented 7 years ago

Which version of npm do you have installed? We require npm 3+.

I've just tried that on my machine without any issue:

$ node -v
v8.0.0
$ npm -v
5.0.0
$ git clone https://github.com/Kitware/visualizer.git
Cloning into 'visualizer'...
remote: Counting objects: 2213, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 2213 (delta 20), reused 15 (delta 1), pack-reused 2170
Receiving objects: 100% (2213/2213), 3.95 MiB | 688.00 KiB/s, done.
Resolving deltas: 100% (1423/1423), done.
$ cd visualizer/
$ npm i
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated wrench@1.5.8: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
npm WARN deprecated conventional-changelog@0.0.17: Please update conventional-changelog to >1.0.0. If you are running the cli, use conventional-changelog-cli
npm WARN deprecated feature-filter@2.2.0: This package has been merged into the 'mapbox-gl-style-spec' package
npm WARN deprecated mapbox-gl-function@1.3.0: This package has been merged with the 'mapbox-gl-style-spec' package
npm WARN deprecated mapbox-gl-js-supported@1.1.0: This project has been renamed to mapbox-gl-supported. Install using mapbox-gl-supported instead.
npm WARN deprecated mapbox-gl-style-spec@8.11.0: This package has been replaced by @mapbox/mapbox-gl-style-spec
npm WARN deprecated point-geometry@0.0.0: This module has moved: please install @mapbox/point-geometry instead
npm WARN deprecated shelf-pack@1.1.0: This module is now under the @mapbox namespace: install @mapbox/shelf-pack instead
npm WARN deprecated unitbezier@0.0.0: This module has moved: switch to @mapbox/unitbezier
npm WARN deprecated vector-tile@1.3.0: This module has moved: please install @mapbox/vector-tile instead
npm WARN deprecated geojson-area@0.1.0: This module is now under the @mapbox namespace: install @mapbox/geojson-area instead
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global jsonlint-lines-primitives@1.6.0 should be installed with -g

> utf-8-validate@1.2.2 install /Users/seb/Documents/code/Web/visualizer/node_modules/utf-8-validate
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node

> fsevents@1.1.2 install /Users/seb/Documents/code/Web/visualizer/node_modules/fsevents
> node install

[fsevents] Success: "/Users/seb/Documents/code/Web/visualizer/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> bufferutil@1.2.1 install /Users/seb/Documents/code/Web/visualizer/node_modules/bufferutil
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node

> spawn-sync@1.0.15 postinstall /Users/seb/Documents/code/Web/visualizer/node_modules/spawn-sync
> node postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN minifyify@7.3.5 requires a peer of browserify@>= 5 but none was installed.

added 1525 packages in 52.893s
$ npm run build

> pvw-visualizer@0.0.0-semantically-release build /Users/seb/Documents/code/Web/visualizer
> fix-autobahn && webpack

Hash: f4a1be87be12ba7f8ad2
Version: webpack 1.13.2
Time: 16712ms
                                 Asset     Size  Chunks             Chunk Names
  25a32416abee198dd821b0b17a198a8f.eot  76.5 kB          [emitted]  
e6cf7c6ec7c2d6f670ae9d762604cb0b.woff2  71.9 kB          [emitted]  
 c8ddf1e5e5bf3682bc7bebf30f394148.woff  90.4 kB          [emitted]  
  1dc35d25e61d819a9c357074014867ab.ttf   153 kB          [emitted]  
  d7c639084f684d66a1bc66855d193ed8.svg   392 kB          [emitted]  
                         Visualizer.js  3.31 MB       0  [emitted]  main
    + 511 hidden modules
wgui1 commented 7 years ago

Thanks for the quick response. I followed your steps and problem disappeared. previously I chose a npm mirror from taobao seems had problem.