multiversx / mx-ping-pong-sc

GNU General Public License v3.0
14 stars 13 forks source link

cloning and running `npm install` does not work #4

Closed bogdan-marian closed 2 years ago

bogdan-marian commented 2 years ago

I just realized that this issue was supposed to be opened in the frontend react part of the code that is designed to interact with this smart contract: https://github.com/ElrondNetwork/dapp-template. Feel free to delete this issue in order to avoid confusion.

I'm trying to learn. I just cloned this project and run npm install but no joy. Here is the errors that npm tool reported.


npm ERR! code 1
npm ERR! path /home/bogdan/workspace/my-notes/elrond-workspace/e08-guide/dapp/node_modules/usb
npm ERR! command failed
npm ERR! command sh -c prebuild-install --runtime napi --target 4 --verbose || node-gyp rebuild
npm ERR! prebuild-install info begin Prebuild-install version 5.3.6
npm ERR! prebuild-install info install installing standalone, skipping download.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@17.2.0 | linux | x64
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack 
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1062:16)
npm ERR! gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:448:11)
npm ERR! gyp ERR! stack     at Socket.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Pipe.<anonymous> (node:net:687:12)
npm ERR! gyp ERR! System Linux 5.11.0-43-generic
npm ERR! gyp ERR! command "/home/bogdan/.linuxbrew/Cellar/node/17.2.0/bin/node" "/home/bogdan/workspace/my-notes/elrond-workspace/e08-guide/dapp/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/bogdan/workspace/my-notes/elrond-workspace/e08-guide/dapp/node_modules/usb
npm ERR! gyp ERR! node -v v17.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bogdan/.npm/_logs/2021-12-31T10_51_22_306Z-debug.log
bogdan-marian commented 2 years ago

I was able to get past this error by downgrading from node14 to node12. On my Ubuntu system, I have node installed via brew. This is how I downgraded.

brew install node@12
brew unlink node
brew link --overwrite node@12