sentinel-hub / EOBrowser

The Earth Observation Browser is a search tool for Sentinel-1, -2, -3, Landsat 5, 7, 8, Modis and Envisat satellite imagery
MIT License
78 stars 24 forks source link

npm install gyph error #4

Closed Koesters closed 4 years ago

Koesters commented 5 years ago

Windows 10 (64bit) under cmder.exe https://cmder.net/ Usually works fine with other npm installs (ie angular etc)

npm install

E:\yyy\eobrowser\EOBrowser\node_modules\integer>if not defined npm_config_node_gyp (node "C:\Users\xxx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\xxx\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\xxx\AppData\Local\Programs\Python\Python37\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:273:12)
gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:936:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxx\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\yyy\eobrowser\EOBrowser\node_modules\integer
gyp ERR! node -v v9.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

added 1885 packages from 1739 contributors and audited 15797 packages in 195.441s
found 546 vulnerabilities (85 low, 427 moderate, 33 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

npm start

> EOBrowser@1.1.0 start E:\yyy\eobrowser\EOBrowser
> node -r dotenv/config ./node_modules/.bin/react-scripts start dotenv_config_path=config/development.env

E:\yyy\eobrowser\EOBrowser\node_modules\.bin\react-scripts:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (module.js:613:28)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! EOBrowser@1.1.0 start: `node -r dotenv/config ./node_modules/.bin/react-scripts start dotenv_config_path=config/development.env`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the EOBrowser@1.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
zigacernigoj commented 5 years ago

Hi, thanks for reporting the issue.

The error in first part with npm install happens because node_gyp needs Python 2.7, unfortunately it doesn't support 3.x and it looks like you have Python 3.7.

python (v2.7 recommended, v3.x.x is not supported)

I think it's best to try to (re)install node-gyp according to instrustions on npm js website for node-gyp. Option 1 worked for me.

Then, please try again with npm install and npm start and report if the second part still remains. There is a slight chance that the second error isn't related to the first one, but we didn't figure that out yet.