three-geo icon indicating copy to clipboard operation
three-geo copied to clipboard

error with es-pack-js when executing 'npm i'

Open letsgo0 opened this issue 3 years ago • 4 comments

Hope someone know this problem. I just clone this repo, cd three-geo and npm i, then comes this error below.

node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

[email protected] postinstall D:\gisdemo8threejs\three-geo\node_modules\es-pack-js (cd ./node-polyfill && npm run install); (cd ./rustwasm-polyfill && npm i);

此时不应有 (cd。 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\es-pack-js\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: (cd ./node-polyfill && npm run install); (cd ./rustwasm-polyfill && npm i); npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall 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:

letsgo0 avatar Aug 22 '21 10:08 letsgo0

Have you solved the problem yet?I ran into the same problem

canglangshushu avatar Sep 12 '21 04:09 canglangshushu

Same here, can't get the example running locally

Bextia avatar Nov 10 '21 08:11 Bextia

To my knowledge, this error happens when building on Windows.

Using the latest es-pack-js (v0.5.3 with partial Windows support) might help:

$ npm config set script-shell bash
$ npm i [email protected]
$ npm run build

Updates (2022-03-22): As of 36f0862, building three-geo on Windows should just work by

$ npm config set script-shell bash
$ npm run build

j-devel avatar Nov 11 '21 02:11 j-devel

yes, I'm working on Windows.

I've tried your proposed solution and got this error on the second command:

image

Bextia avatar Nov 17 '21 11:11 Bextia

Hello.

Windows user here, same error.

npm run build

[email protected] build es-pack build -m umd

/bin/bash: es-pack: command not found

Any clues?

sonicviz avatar Mar 24 '23 05:03 sonicviz

/bin/bash: es-pack: command not found

Try npm i first?

j-devel avatar Mar 24 '23 13:03 j-devel

Yes, already did fails. Tried npm i [email protected] and fails.

Switching to WSL.

sonicviz avatar Mar 24 '23 13:03 sonicviz

Yes, already did fails. Tried npm i [email protected] and fails.

Please try npm i [email protected] (latest version 0.5.13, not 0.5.3). Still fail?

j-devel avatar Mar 24 '23 13:03 j-devel

I switched to WSL2, installed nvm, node etc according to https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl

All checks out, everything installed. Opened Geo in VScode in WSL via code .

Try npm i or npm i three-geo but it fails now on: npm ERR! /bin/bash: node: command not found

But node is installed.

node --version v18.12.1

sonicviz avatar Mar 24 '23 14:03 sonicviz

I switched to WSL2, installed nvm, node etc according to https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl

All checks out, everything installed. Opened Geo in VScode in WSL via code .

Sorry, I am not familiar with the Windows environment...

FYI - latest CI build on Windows (via GitHub Action's Docker) https://github.com/w3reality/three-geo/actions/runs/4459639864/jobs/7832217785

j-devel avatar Mar 24 '23 14:03 j-devel

Apologies. my mistake. I had skipped a step and VScode wasn't fully hooking into WSL when I booted the project.

Fixed it, and it's all working fine under WSL2 as per your original docs (after installing node etc as per MS instructions above).

Thanks for the help, sounding board helps troubleshoot. Sorry to bother you, but at least you can add some extra instructions perhaps for WIndows users now to use WSL. Microsoft actually recommends this for js development now anyway, so all good.

Looking forward to having a play with it, some great work you've done there!

You might be interested in what I want to add actually, could be a useful addition. Haven't done three.js for a while so kind of starting from scratch again.

sonicviz avatar Mar 24 '23 14:03 sonicviz

@sonicviz I have added some notes regarding this.

Thanks for your interest, and looking forward to seeing enhancements!

j-devel avatar Mar 25 '23 05:03 j-devel

No problem.

Q: How do you calculate terrain height relative to the position units in three.js, which are also dependant on the zoom factor?

For example, if I want to position an object 1m above sea level (which according to https://docs.mapbox.com/data/tilesets/guides/access-elevation-data/#mapbox-terrain-rgb sea level is 0) how do I translate that into a relative mesh position,z value that will translate it a unit of 1m (or 10m or whatever) relative to the scale of the mesh terrain elevation?

Also. how does that position calculation change based on the zoom factor, which can be from 11 to 17?

sonicviz avatar Mar 25 '23 07:03 sonicviz

Q: How do you calculate terrain height relative to

Okay, I think this is a different issue topic. Could you open a new thread?

j-devel avatar Mar 27 '23 06:03 j-devel

aok, done. ty

sonicviz avatar Mar 27 '23 07:03 sonicviz