How to fix gyp ERR! build error using npm? - reactjs

I've been using cmd truffle unbox react to create react files in my dapp. However, every time I command it, it pops up gyp ERR! build error. I don't know how to fix it. Please help!
I've tried this, still not working.
https://github.com/nodejs/node-gyp/issues/983
C:\Users\ASUS\Desktop\truffle-react Dapp>truffle unbox react
√ Preparing to download
√ Downloading
√ Cleaning up temporary files
- Setting up boxgyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
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\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ASUS\Desktop\truffle-react Dapp\client\node_modules\scrypt
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2019-08-19T05_46_55_107Z-debug.log
× Setting up box
Error: Command failed: cd client && npm install
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
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\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ASUS\Desktop\truffle-react Dapp\client\node_modules\scrypt
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2019-08-19T05_46_55_107Z-debug.log
at checkExecSyncError (child_process.js:631:11)
at execSync (child_process.js:668:15)
at Object.installBoxDependencies (C:\Users\ASUS\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-box\lib\utils\unbox.js:118:1)
at Object.setUpBox (C:\Users\ASUS\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-box\lib\utils\index.js:62:1)
at Object.unbox (C:\Users\ASUS\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-box\box.js:58:1)
Truffle v5.0.32 (core: 5.0.32)
Node v12.1.0

I had a similar issue. It was due to a dependency not being compatible with the latest version of Node. I recommend using NVM to temporally roll back the Node version and try again.

Related

npm ERR! code 1.Why this error massage gonna happen npm ERR! code 1? How can I fix it

This is error code :
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'reactjs-percentage-circle#1.0.0',
npm WARN EBADENGINE required: { node: '>=6.0.0', npm: '~3.3.6' },
npm WARN EBADENGINE current: { node: 'v15.10.0', npm: '7.16.0' }
npm WARN EBADENGINE }
npm ERR! code 1
npm ERR! path D:\Buman Project\geniusClone\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
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#15.10.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (D:\Buman Project\geniusClone\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (D:\Buman Project\geniusClone\node_modules\node-gyp\lib\configure.js:509:16)npm ERR! gyp ERR! stack at callback (D:\Buman Project\geniusClone\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:196:21)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Buman Project\\geniusClone\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\Buman Project\geniusClone\node_modules\node-sass
npm ERR! gyp ERR! node -v v15.10.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! C:\Users\Zolboo\AppData\Local\npm-cache\_logs\2021-06-06T12_41_51_207Z-debug.log
There are two problems
Is a warning (which can probably ignored) This package requires an npm version ~3.3.6 which means >= 3.3.6 and < 3.4 ie, every 3.3.x where x >= 6. You have npm version 7.16. which does not fulfil this requirement. Futhermore,
node-gyp requires a python installation on your system and didn't find any ... See the docs on how to install and configure node-gyp on windows.

Can't install redux & react-redux

I am using these commands to install redux:
npm install redux
npm install --save redux
npm install --save redux --force
The same commands to install react-redux with replacing redux in the above commands.
npm install react-redux
npm install --save react-redux
npm install --save react-redux --force
But the issue is, it installs normally in Windows C Directory and when I import and use it:
import {bindActionCreators,createStore, applyMiddleware} from 'redux'
import {connect, Provider } from 'react-redux'
It Displays the Following Error:
Uncaught Error: Cannot find module 'react-redux'
Then, I stop the Server and install it in Project Directory it displays the Following Error.
npm WARN using --force Recommended protections disabled.
npm ERR! code 1
npm ERR! path E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\Kashif Iftikhar\University\FYP\Code\React Native\Plantonics\node_modules\grpc\src\node\extension_binary\node-v88-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc\src\node\extension_binary\node-v88-win32-x64-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp#0.14.0
npm ERR! node-pre-gyp info using node#15.11.0 | win32 | x64
npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc\src\node\extension_binary\node-v88-win32-x64-unknown\grpc_node.node" (not found)
npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v88-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v88-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v88-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for grpc#1.24.2 and node#15.11.0 (node-v88 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v88-win32-x64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#7.1.2
npm ERR! gyp info using node#15.11.0 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#7.1.2
npm ERR! gyp info using node#15.11.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.8.5 found at "C:\Users\Qasim Iftikhar\anaconda3\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:333:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:378:20)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! System Windows_NT 10.0.10240
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=E:\\Kashif Iftikhar\\Coding\\Projects\\Latest Projects\\React Native\\Plantonics\\node_modules\\grpc\\src\\node\\extension_binary\\node-v88-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\\Kashif Iftikhar\\Coding\\Projects\\Latest Projects\\React Native\\Plantonics\\node_modules\\grpc\\src\\node\\extension_binary\\node-v88-win32-x64-unknown" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v88"
npm ERR! gyp ERR! cwd E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc
npm ERR! gyp ERR! node -v v15.11.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc\src\node\extension_binary\node-v88-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc\src\node\extension_binary\node-v88-win32-x64-unknown --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:378:20)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.10240
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\Kashif Iftikhar\\Coding\\Projects\\Latest Projects\\React Native\\Plantonics\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd E:\Kashif Iftikhar\Coding\Projects\Latest Projects\React Native\Plantonics\node_modules\grpc
npm ERR! node-pre-gyp ERR! node -v v15.11.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Qasim Iftikhar\AppData\Local\npm-cache\_logs\2021-03-26T06_53_12_689Z-debug.log
Also there is no "lodash-es": "~4.0.0" in my Package.json file.
Note: I am Building App with Expo CLI and just imported Redux to fetch data from Google Firebase.
Remove node_modules and reinstall, or try use yarn
rm -rf node_modules/ && npm install

NPM throws error while installing quick.db

I am trying to install quick.db to get started with databases and SQLite3 specifically, but when I try installing it, it always throws an error. The NPM version I have is 6.14.11 and Node version is v14.16.0.
> better-sqlite3#7.1.2 install E:\JAVASCRIPT\Tutorials\DATABASES\node_modules\better-sqlite3
> prebuild-install || npm run build-release
prebuild-install WARN install No prebuilt binaries found (target=14.16.0 runtime=node arch=x64 libc= platform=win32)
> better-sqlite3#7.1.2 build-release E:\JAVASCRIPT\Tutorials\DATABASES\node_modules\better-sqlite3
> node-gyp rebuild --release
E:\JAVASCRIPT\Tutorials\DATABASES\node_modules\better-sqlite3>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 --release ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
gyp ERR! System Windows_NT 10.0.19041
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" "--release"
gyp ERR! cwd E:\JAVASCRIPT\Tutorials\DATABASES\node_modules\better-sqlite3
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3#7.1.2 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3#7.1.2 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\gigabyte\AppData\Roaming\npm-cache\_logs\2021-03-14T09_23_59_004Z-debug.log
npm WARN databases#1.0.0 No description
npm WARN databases#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3#7.1.2 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3#7.1.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\gigabyte\AppData\Roaming\npm-cache\_logs\2021-03-14T09_23_59_397Z-debug.log
After juggling through the internet, I finally found the correct answer that works.
Here is the link to that:https://stackoverflow.com/questions/55152761/npm-wont-install-quick-db-returns-these-errors#:~:text=All%20you%20have%20to%20do,I%20found%20this%20solution%20here!
The first answer is perfect!

npm: Why is it giving an error with "node-pre-gyp"?

I have created a new Angular project and I ran npm i.
As soon as I did that, some installs were successful until I got the following error on my Terminal.
I have already uninstalled node-gyp and re-installed.
node-pre-gyp WARN Pre-built binaries not installable for fsevents#1.2.9 and node#12.5.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/build'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:200:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Darwin 18.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents
node-pre-gyp ERR! node -v v12.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
I was hoping for npm i to run smoothly, but instead, I received that error.
Your project uses (probably indirectly) a native module. Since it doesn't have a pre-built module for the combination of your OS and Node version, npm attempts to build it locally. It eventually fails with this error:
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/isaac/Desktop/Tutorials/Angular/ng-refresher/node_modules/fsevents/build'
Make sure the user you're using to run npm install has the permissions to create that directory, and rerun npm install.

I was trying to run sb-admin-bs4-angular2-master which is an nodejs app and getting the following error when i run npm install

enter image description here
first i run npm install -g ts-node
then i run npm install which gives me following error...no idea what to do..
when i run it by npm start ... it gives me more errors of gulp server or something
C:\Users\Raheel\Downloads\SB-Admin-BS4-Angular-2-master\SB-Admin-BS4-Angular-2-master\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify>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" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Users\Raheel\AppData\Local\Programs\Python\Python35-32\python.EXE" is v3.5.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:406:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:395:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at maybeClose (internal/child_process.js:827:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
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:\Users\Raheel\Downloads\SB-Admin-BS4-Angular-2-master\SB-Admin-BS4-Angular-2-master\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v4.4.3
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.3
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! contextify#0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify#0.1.15 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Raheel\Downloads\SB-Admin-BS4-Angular-2-master\SB-Admin-BS4-Angular-2-master\npm-debug.log
C:\Users\Raheel\Downloads\SB-Admin-BS4-Angular-2-master\SB-Admin-BS4-Angular-2-m
aster>
In the first lines you can read :
Error: Python executable "C:\Users\Raheel\AppData\Local\Programs\Python\Python35-32\python.EXE" is v3.5.1, which is not supported by gyp.
Check that you have python 2.5 installed, seems like npm can't use python 3.x
If I'm not wrong, you need a python version which is 2.5 or higher but lower than 3.0.
Check npm doc for more.

Resources