timofeysie / gosh

Electron kiosk app in various flavours
0 stars 0 forks source link

Error: Command failed: C:\Windows\py.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3]; #11

Open timofeysie opened 5 years ago

timofeysie commented 5 years ago

Using Ionic/Capacitor on Windows.

\electron>npx cap open electron
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Windows\py.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:304:12)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:1000:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\timof\\AppData\\Roaming\\nvm\\v12.0.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\timof\AppData\Roaming\npm-cache\_npx\4204\node_modules\cap
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cap@0.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cap@0.2.1 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!     C:\Users\timof\AppData\Roaming\npm-cache\_logs\2019-09-14T03_12_19_361Z-debug.log
Install for [ 'cap@latest' ] failed with code 1
timofeysie commented 5 years ago

After having issues with Ionic setup, and getting similar issues with an plain Angular version. When creating an Angular/Electron flavor, after getting this error:

electron Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.

Following the advice here fixed the issue. "target": "es5",