I needed to create unit tests for React application. I'm new to React, so I have troubles with setting things up.
My code is
import React from 'react';
import Enzyme, {shallow, mount} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
VS code is saying "Could not find a declaration file for module 'enzyme-adapter-react-16'" and suggests to run npm i --save-dev #types/enzyme-adapter-react-16.
I did that and I got this error:
npm ERR! code 1
npm ERR! path C:\WORK_2\GIT\XXX\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#10.19.0 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Program Files\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:198:13)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\WORK_2\\GIT\\XXX\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\WORK_2\GIT\XXX\node_modules\node-sass
npm ERR! gyp ERR! node -v v10.19.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
EDIT: I fixed this error by installing Python 2.7, but got another one:
npm ERR! code 7
npm ERR! path C:\WORK_2\GIT\XXX\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#10.19.0 | win32 | x64
npm ERR! gyp http GET https://nodejs.org/download/release/v10.19.0/node-v10.19.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v10.19.0/node-v10.19.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v10.19.0/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v10.19.0/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v10.19.0/win-x86/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v10.19.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v10.19.0/win-x64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v10.19.0/win-x86/node.lib
npm ERR! gyp info spawn C:\Python27\python.exe
npm ERR! gyp info spawn args [ 'C:\\WORK_2\\GIT\\XXX\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-G',
npm ERR! gyp info spawn args 'msvs_version=2015',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\WORK_2\\GIT\\XXX\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\WORK_2\\GIT\\XXX\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\XXX\\.node-gyp\\10.19.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\XXX\\.node-gyp\\10.19.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\WORK_2\\GIT\\XXX\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\XXX\\.node-gyp\\10.19.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\WORK_2\\GIT\\XXX\\node_modules\\node-sass',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\WORK_2\\GIT\\XXX\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.' ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn args [ 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
npm ERR! gyp ERR! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
npm ERR! gyp ERR! stack at onErrorNT (internal/child_process.js:415:16)
npm ERR! gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\WORK_2\\GIT\\XXX\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\WORK_2\GIT\XXX\node_modules\node-sass
npm ERR! gyp ERR! node -v v10.19.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! This is a bug in `node-gyp`.
npm ERR! gyp ERR! Try to update node-gyp and file an Issue if it does not help:
npm ERR! gyp ERR! <https://github.com/nodejs/node-gyp/issues>
I finally solved it myself, I needed to run first
npm rebuild node-sass
And then:
#types/enzyme-adapter-react-16
Not sure why this happens, it seems that project uses node-sass for something and it causes issues.
Related
OS: M1 Monterey
Node version: v16.14.2
Terminal: iTerm
Do any of you know why i can't run npm install on my work project
this is the error output
npm ERR! code 1
npm ERR! path /Users/bendoro/Documents/work/intern/sirclo-frontend/sirclo-repo/prius-fe/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /Users/bendoro/.nvm/versions/node/v16.14.2/bin/node /Users/bendoro/Documents/work/intern/sirclo-frontend/sirclo-repo/prius-fe/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/Users/bendoro/.nvm/versions/node/v16.14.2/bin/node',
npm ERR! gyp verb cli '/Users/bendoro/Documents/work/intern/sirclo-frontend/sirclo-repo/prius-fe/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.14.2 | darwin | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "/Users/bendoro/.pyenv/shims/python3" in the PATH
npm ERR! gyp verb `which` succeeded /Users/bendoro/.pyenv/shims/python3 /Users/bendoro/.pyenv/shims/python3
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /Users/bendoro/.pyenv/shims/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:399:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! stack at Socket.<anonymous> (node:internal/child_process:451:11)
npm ERR! gyp ERR! stack at Socket.emit (node:events:526:28)
npm ERR! gyp ERR! stack at Pipe.<anonymous> (node:net:687:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/Users/bendoro/.nvm/versions/node/v16.14.2/bin/node" "/Users/bendoro/Documents/work/intern/sirclo-frontend/sirclo-repo/prius-fe/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/bendoro/Documents/work/intern/sirclo-frontend/sirclo-repo/prius-fe/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
i try running npm install when this error output come out.
anyone here know how to fix this? thank you
I am working on an inherited ReactJS project and I have not touched the github actions. I've successfully deployed multiple commits without any issue, but today I received an error from the Github action and I'm having a hard time working out the problem.
There are a number of warnings about depreciated libraries but I don't believe they are causing the issue - they've always been there and I am not in a rush to change as there may be other unintended consequences.
I haven't updated anything in the project other than some source code.
Here is the log. Any pointers would be greatly appreciated.
npm ERR! code 1
npm ERR! path /github/workspace/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c -- node scripts/build.js
npm ERR! Building: /opt/nodejs/16.18.0/bin/node /github/workspace/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/opt/nodejs/16.18.0/bin/node',
npm ERR! gyp verb cli '/github/workspace/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.18.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (/github/workspace/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/github/workspace/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/github/workspace/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /github/workspace/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /github/workspace/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /github/workspace/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:202:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (/github/workspace/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/github/workspace/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/github/workspace/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /github/workspace/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /github/workspace/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /github/workspace/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:202:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python /opt/python/latest/bin/python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /opt/python/latest/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:402:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1100:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! gyp ERR! System Linux 5.15.0-1022-azure
npm ERR! gyp ERR! command "/opt/nodejs/16.18.0/bin/node" "/github/workspace/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /github/workspace/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.18.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! /github/home/.npm/_logs/2022-11-09T02_26_49_887Z-debug-0.log
I've omitted the original warnings above these errors as I don't appear to be able to paste the whole amount in.
Hi discovered the node version and NPM versions in the GitHub action build were different to previous commits. I don't know what forced it to change the version (nothing in my code), but I did discover I hadn't set the engine values in the package.json.
I added the following to restore the previous versions:
"engines": {
"node": "14.19.1",
"npm": "6.14.16"
},
This forced it to pick up the correct versions and deployed successfully.
Hope this helps someone.
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
I am getting this error when I am trying to install React Slingshot. How can I get rid of this?
Same problem when I am running 'npm run setup' cmd. I am using node version v14.16.0 npm version 7.5.2.
npm ERR! code 1
npm ERR! path C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'C:\\Users\\kapil\\Downloads\\react-slingshot-master\\react-slingshot-master\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#14.16.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:183:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:183:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python C:\Python39\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:308:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kapil\\Downloads\\react-slingshot-master\\react-slingshot-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\kapil\Downloads\react-slingshot-master\react-slingshot-master\node_modules\node-sass
npm ERR! gyp ERR! node -v v14.16.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kapil\AppData\Local\npm
-cache\_logs\2021-03-01T07_07_49_867Z-debug.log
Specify Python 2 during your installation, like this:
npm i some-package --python=python2.7
Edit:
It looks like you're missing python 2. Install Python 2 and specify it during your installation.
How to install angular using npm on Windows 8.1 64bit?
I have installed:
node v.0.10.32
npm v.1.4.28
Python v2.7.8
Microsoft Visual Studio Express 2012 for Windows 8
Microsoft Visual C++ 2012
If I run npm install angular in Developer Command Prompt for VS2012 I get this error:
c:\.....\.node-gyp\0.10.32\deps\uv\include\uv-private/uv-win.h(
32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or
directory [c:\.......\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\.....\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "D:\\robocat\\tools\\nodejs\\node_modules\\npm\\node_mod
ules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\....\node_modules\an
gular\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! contextify#0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify#0.1.9 install script.
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 their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\.....\\nodejs\\\\node.exe" "D:\\robocat\\tools\\n
odejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "angular"
npm ERR! cwd c:\
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
But, if I run in CMD, i get this error:
c:\Users\....\node_modules\angular\node_m
odules\jsdom\node_modules\contextify\build\contextify.vcxproj(18,3): error MSB4
019: The imported project "c:\Microsoft.Cpp.Default.props" was not found. Confi
rm that the path in the <Import> declaration is correct, and that the file exis
ts on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\robocat\tools\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "D:\......\\nodejs\\node_modules\\npm\\node_mod
ules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\......\node_modules\an
gular\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! contextify#0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify#0.1.9 install script.
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 their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\......\\nodejs\\\\node.exe" "D:\\robocat\\tools\\n
odejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "angular" "--save"
npm ERR! cwd c:\angular-playground
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0