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

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

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.

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

I am Trying to run a titanium project in ios simulator but getting some node error

I am Trying to run a titanium project with appcelerator studio in simulator but getting some node error, I have used same node version from which it was developed, please help me out
Error below
File
"/Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 971, in WriteActions
"Spaces in action output filenames not supported (%s)" % output)
"Spaces in action output filenames not supported (%s)" % output)
AssertionError: Spaces in action output filenames not supported (/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/build/MobileDevice.framework)
AssertionError: Spaces in action output filenames not supported (/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/build/MobileDevice.framework)
gyp ERR! configure error
gyp ERR! configure error
gyp ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/bin/node" "/Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/binding/node-v79-darwin-x64/node_ios_device.node" "--module_name=node_ios_device" "--module_path=/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/binding/node-v79-darwin-x64" "--napi_version=5" "--node_abi_napi=napi"
gyp ERR! cwd /Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device
gyp gyp ERR!ERR! Systemnode -v Darwin 19.0.0
v13.6.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR!gyp commandERR! "/usr/local/bin/node" "/Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/binding/node-v79-darwin-x64/node_ios_device.node" "--module_name=node_ios_device" "--module_path=/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/binding/node-v79-darwin-x64" "--napi_version=5" "--node_abi_napi=napi"
not ok
gyp ERR! cwd /Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device
gyp ERR! node -v v13.6.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/binding/node-v79-darwin-x64/node_ios_device.node --module_name=node_ios_device --module_path=/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device/binding/node-v79-darwin-x64 --napi_version=5 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:321:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1028:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Darwin 19.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/czmac01/Library/Application Support/Titanium/mobilesdk/osx/9.1.0.v20200422074103/node_modules/node-ios-device
node-pre-gyp ERR! node -v v13.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
I would stick to the LTS version 12.16.x and try to re-install the node packages after you moved to node 12.16.x:
npm install -g titanium appcelerator alloy
Also keep in mind: 9.1.0.v20200422074103 is a nightly build, so not a supported version.
Another thing to look at:
Since there is this error Spaces in action output filenames not supported you could edit:
/Users/czmac01/.appcelerator/install/8.0.0/package/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py and add a log where it throws that error to see which file is making the problem.

Error with npm-gyp during npm rebuild

when I make sudo npm rebuild initially everything works correctly but then I get this type of error:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.13.0-63-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/.../.../node_modules/pg
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
How can I fix this issue?

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

Resources