npm protobuf fails - node.js

I am using windows 7, and get this error when doing
npm install protobuf
D:\Projects\EventstoreSample\node_modules\protobuf>node "C:\Program Files\nodejs
\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"
rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: File "<string>", line 1
gyp ERR! stack import platform; print platform.python_version();
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:540:15)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at maybeClose (child_process.js:638:16)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Projects\EventstoreSample\node_modules\protobuf
My pythonpath variable in environment variables, is set to :
"C:\Python33\Lib;C:\Python33\DLLs;"
On typing python in my command prompt takes me to python shell.
How do I fix this issue?
PS : I have never used python. Installed it because of this dependency.

Related

MSBUILD : Configuration error MSB4148 "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" has zero length

I'm trying yo install electron-chromedrive by using yarn, so by doing this command:
yarn add --dev electron-chromedriver --network-timeout 100000
But it gives the following error:
MSBUILD : Configuration error MSB4148 "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" has zero length
Precisely:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\vipul\AppData\Roaming\nvm\v16.14.2\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:526:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19043
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\vipul\software\desktop\webapp\src
gyp ERR! node -v v16.14.2
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
error Command failed with exit code 1.
How can I solve it?
I've solved the issue by removing the following MSBUILD keys in the registory editor:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\4.0
And after, that I've reinstalled Visual Studio again.

I'm setting up an ionic project and getting these errors when run the command npm install

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:149:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-lifecycle\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\test-proj\Angular\ionic-test\node_modules\ed25519
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Your problem is about python, not node or angular. There are a lot of questions about python path problem like:
npm - "Can't find Python executable "python", you can set the PYTHON env variable."
https://github.com/iost-official/explorer/issues/1
https://hisk.io/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows/
I installed windows build tools and it solved my problem.

Cannot rebuild node-gyp with exit code null

I'm trying to use node-gyp rebuild, but I encountered a weird issue.
I think I have followed almost every thread.
I am running the command on macOS BigSur 11.2.2, Apple Silicon.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: null
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (node:events:376:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/.../Path
gyp ERR! node -v v15.5.1
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok

Having Problems Installing node-xmpp-server on My 64-bit Windows System

Can anybody help me with this error I keep getting trying to install node-xmpp-server. I already installed all the dependencies.
C:\windows\system32\node_modules\node-xmpp-server\node_modules\ws\node_modules\bufferutil>if not defined npm_config_node
_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebu
ild ) else (node rebuild )
gyp: binding.gyp not found (cwd: C:\windows\system32\node_modules\node-xmpp-server\node_modules\ws\node_modules\bufferut
il) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configur
e.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
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:\windows\system32\node_modules\node-xmpp-server\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3

node-gyp build error 'msbuild failed with error code 1'

I am getting this error while I try to run
node-gyp build
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Users\Ramya\AppData\Roaming\npm\no
de_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Users\\Ramya\\AppDat
a\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build"
gyp ERR! cwd f:\ontology\api\ontoapi\example\node_modules
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
i already have set --msvs_verion=2013. I already have set path for python 2.7 also. I am using Windows 8.1, nodejs - 0.12.2, npm- 2.7.4, node-gyp- 1.0.3

Resources