0
votes

I'm new to node and trying to build a project that doesn't have much instructions with it. So I've been trying various suggestions but haven't made much progress.

What does the following npm build error mean?

[email protected] install /Users/matt/src/work/indy-sdk/vcx/wrappers/node/node_modules/ref node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: Command failed: /usr/local/opt/python/libexec/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", 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:297:12) gyp ERR! stack at ChildProcess.emit (events.js:197:13) gyp ERR! stack at maybeClose (internal/child_process.js:978:16) gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:395:11) gyp ERR! stack at Socket.emit (events.js:197:13) gyp ERR! stack at Pipe._handle.close (net.js:611:12) gyp ERR! System Darwin 18.2.0 gyp ERR! command "/usr/local/Cellar/node/11.9.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/matt/src/work/indy-sdk/vcx/wrappers/node/node_modules/ref gyp ERR! node -v v11.9.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN [email protected] requires a peer of webpack@1 || ^2.1.0-beta but none is installed. You must install peer dependencies yourself.

I'm new to node and trying to build a project that doesn't any build instructions with it. I've already run suggestions found on slack:

  • npm i
  • npm install
  • npm install webpack --save-dev
  • npm audit fix

None of these have progressed my progress on solving the problem.

It looks like I am suppose to manually install some dependencies but I am unsure what that involves.....?

Thnx

1
It's trying to execute python script and get syntax error. Check your python version, is it 3.6?Ninh Pham
once I followed the answer below, I no longer get build errors. I double checked, just to make sure there are not other potential problems. I am using python version 3.7.2.i.do.stuff

1 Answers

1
votes

Try updating npm:

npm install npm@latest -g

Sometimes npm is the root cause, not the packages.

Edit: After you update npm, if nothing changes reinstall the packages.