Error building VegaLite

I am trying to use Agents.jl package. However, while trying to add the package, I get the following error

  Building MbedTLS ─→ `~/.julia/packages/MbedTLS/a1JFn/deps/build.log`
  Building NodeJS ──→ `~/.julia/packages/NodeJS/rx0mH/deps/build.log`
  Building VegaLite → `~/.julia/packages/VegaLite/sHyyT/deps/build.log`
┌ Error: Error building `VegaLite`: 
│ 
│ > canvas@2.5.0 install /root/.julia/packages/VegaLite/sHyyT/deps/node_modules/canvas
│ > node-pre-gyp install --fallback-to-build
│ 
│ sh: 1: node-pre-gyp: Permission denied
│ npm ERR! file sh
│ npm ERR! code ELIFECYCLE
│ npm ERR! errno ENOENT
│ npm ERR! syscall spawn
│ npm ERR! canvas@2.5.0 install: `node-pre-gyp install --fallback-to-build`
│ npm ERR! spawn ENOENT
│ npm ERR! 
│ npm ERR! Failed at the canvas@2.5.0 install 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!     /root/.npm/_logs/2019-10-18T10_55_54_204Z-debug.log
│ ERROR: LoadError: failed process: Process(setenv(`/root/.julia/packages/NodeJS/rx0mH/deps/bin/node-v10.15.0-linux-x64/bin/node /root/.julia/packages/NodeJS/rx0mH/deps/bin/node-v10.15.0-linux-x64/lib/node_modules/npm/bin/npm-cli.js install --scripts-prepend-node-path=true --production --no-package-lock --no-optional`; dir="/root/.julia/packages/VegaLite/sHyyT/deps"), ProcessExited(1)) [1]
│ 
│ Stacktrace:
│  [1] pipeline_error at ./process.jl:525 [inlined]
│  [2] #run#569(::Bool, ::typeof(run), ::Cmd) at ./process.jl:440
│  [3] run(::Cmd) at ./process.jl:438
│  [4] top-level scope at /root/.julia/packages/VegaLite/sHyyT/deps/build.jl:4
│  [5] include at ./boot.jl:328 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1105
│  [7] include(::Module, ::String) at ./Base.jl:31
│  [8] include(::String) at ./client.jl:432
│  [9] top-level scope at none:5
│ in expression starting at /root/.julia/packages/VegaLite/sHyyT/deps/build.jl:4
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/backwards_compatible_isolation.jl:649

I tried adding VegaLite, building packages, updating them. But, none of them seem to fix the problem.

note:

On what platform are you trying this? We’ve seen this kind of error in docker containers before.

As a temporary workaround, you can pkg> dev VegaLite, and then run npm install --scripts-prepend-node-path=true --production --no-package-lock --no-optional in the folder ~/.julia/dev/VegaLite/deps. You’ll need to install npm manually for that to work.

We are finally very close to fix these problems once and for all. Cairo.jl and Rsvg.jl are now ported to the new BinaryProvider.jl framework, and I believe that this problem will be solved once I port VegaLite.jl back to using Cairo.jl/Rsvg.jl.

1 Like

I have now updated it with the entire output.

I am using Julia on Google Colab. I tried develop VegaLite, and I get the following error

   Cloning git-repo `https://github.com/queryverse/VegaLite.jl.git`
  Updating git-repo `https://github.com/queryverse/VegaLite.jl.git`
 Resolving package versions...
 Installed ConstructionBase ─ v0.1.0
 Installed Setfield ───────── v0.5.0
  Updating `~/.julia/environments/v1.3/Project.toml`
  [112f6efa] + VegaLite v0.7.1-DEV [`~/.julia/dev/VegaLite`]
  Updating `~/.julia/environments/v1.3/Manifest.toml`
  [187b0558] + ConstructionBase v0.1.0
  [efcf1570] + Setfield v0.5.0
  [112f6efa] ↑ VegaLite v0.7.0 ⇒ v0.7.1-DEV [`~/.julia/dev/VegaLite`]
  Building VegaLite → `~/.julia/dev/VegaLite/deps/build.log`
┌ Error: Error building `VegaLite`: 
│ 
│ > canvas@2.6.0 install /root/.julia/dev/VegaLite/deps/node_modules/canvas
│ > node-pre-gyp install --fallback-to-build
│ 
│ sh: 1: node-pre-gyp: Permission denied
│ npm ERR! file sh
│ npm ERR! code ELIFECYCLE
│ npm ERR! errno ENOENT
│ npm ERR! syscall spawn
│ npm ERR! canvas@2.6.0 install: `node-pre-gyp install --fallback-to-build`
│ npm ERR! spawn ENOENT
│ npm ERR! 
│ npm ERR! Failed at the canvas@2.6.0 install 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!     /root/.npm/_logs/2019-10-18T16_39_45_976Z-debug.log
│ ERROR: LoadError: failed process: Process(setenv(`/root/.julia/packages/NodeJS/rx0mH/deps/bin/node-v10.15.0-linux-x64/bin/node /root/.julia/packages/NodeJS/rx0mH/deps/bin/node-v10.15.0-linux-x64/lib/node_modules/npm/bin/npm-cli.js install --scripts-prepend-node-path=true --production --no-package-lock --no-optional`; dir="/root/.julia/dev/VegaLite/deps"), ProcessExited(1)) [1]
│ 
│ Stacktrace:
│  [1] pipeline_error at ./process.jl:525 [inlined]
│  [2] #run#569(::Bool, ::typeof(run), ::Cmd) at ./process.jl:440
│  [3] run(::Cmd) at ./process.jl:438
│  [4] top-level scope at /root/.julia/dev/VegaLite/deps/build.jl:4
│  [5] include at ./boot.jl:328 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1105
│  [7] include(::Module, ::String) at ./Base.jl:31
│  [8] include(::String) at ./client.jl:432
│  [9] top-level scope at none:5
│ in expression starting at /root/.julia/dev/VegaLite/deps/build.jl:4
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/backwards_compatible_isolation.jl:649```

Yes, you’ll get that error when you do the dev, but just ignore that and then run the command I suggested on the command line (if that works), and it should work, in theory :slight_smile: