0

I was getting following error when trying to install any npm package. Sharing the solution for the same in answer.

F:\workspaces\myProject>npm install sphere-node-product-csv-sync --global
npm WARN deprecated [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
C:\Users\sam\AppData\Roaming\npm\product-csv-sync -> C:\Users\sam\AppData\Roaming\npm\node_modules\sphere-node-product-csv-sync\bin\product-csv-sync

> [email protected] install C:\Users\sam\AppData\Roaming\npm\node_modules\sphere-node-product-csv-sync\node_modules\dtrace-provider
> node-gyp rebuild || node suppress-error.js


C:\Users\sam\AppData\Roaming\npm\node_modules\sphere-node-product-csv-sync\node_modules\dtrace-provider>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\sam\AppData\Local\Programs\Python\Python38-32\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:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\sam\AppData\Roaming\npm\node_modules\sphere-node-product-csv-sync\node_modules\dtrace-provider
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
+ [email protected]
added 318 packages from 230 contributors in 88.082s 

1 Answer 1

1

This got solved after rebuilding npm.

npm rebuild node-sass

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.