Everytime I Try To Run NPM Install Terminal throws several errors - javascript

This is on my work laptop. I have Latest version of angular, Nodejs, Nodesass, VScode and mentioned them in Local environment path as well. If I download any Angular template from Github and Try to do NPM Install and it throws these error always. What shall I do to fix these error?
// gyp verb check python checking for Python executable "python2" in the PATH
// gyp verb `which` failed Error: not found: python2
// gyp verb `which` failed at getNotFoundError (D:\Interview\node_modules\which\which.js:13:12)
// gyp verb `which` failed at F (D:\Interview\node_modules\which\which.js:68:19)
// gyp verb `which` failed at E (D:\Interview\node_modules\which\which.js:80:29)
// gyp verb `which` failed at D:\Interview\node_modules\which\which.js:89:16
// gyp verb `which` failed at D:\Interview\node_modules\isexe\index.js:42:5
// gyp verb `which` failed at D:\Interview\node_modules\isexe\windows.js:36:5
// gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:199:21)
// gyp verb `which` failed python2 Error: not found: python2
// gyp verb `which` failed at getNotFoundError (D:\Interview\node_modules\which\which.js:13:12)
// gyp verb `which` failed at F (D:\Interview\node_modules\which\which.js:68:19)
// gyp verb `which` failed at E (D:\Interview\node_modules\which\which.js:80:29)
// gyp verb `which` failed at D:\Interview\node_modules\which\which.js:89:16
// gyp verb `which` failed at D:\Interview\node_modules\isexe\index.js:42:5
// gyp verb `which` failed at D:\Interview\node_modules\isexe\windows.js:36:5
// gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:199:21) {
// gyp verb `which` failed code: 'ENOENT'
// gyp verb `which` failed }
// gyp verb check python checking for Python executable "python" in the PATH
// gyp verb `which` succeeded python C:\Program Files (x86)\Python38-32\python.EXE
// gyp ERR! configure error
// gyp ERR! stack Error: Command failed: C:\Program Files (x86)\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 (node:child_process:333:12)
// gyp ERR! stack at ChildProcess.emit (node:events:376:20)
// gyp ERR! stack at maybeClose (node:internal/child_process:1063:16)
// gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
// gyp ERR! System Windows_NT 10.0.18363
// gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Interview\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
// gyp ERR! cwd D:\Interview\node_modules\node-sass
// gyp ERR! node -v v15.5.1
// gyp ERR! node-gyp -v v3.8.0
// gyp ERR! not ok
// Build failed with error code: 1
// npm ERR! code ELIFECYCLE
// npm ERR! errno 1
// npm ERR! node-sass#4.14.1 postinstall: `node scripts/build.js`
// npm ERR! Exit status 1
// npm ERR!
// npm ERR! Failed at the node-sass#4.14.1 postinstall script.
// npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I think you are using Windows for development. Some node.js modules required to build locally on a machine. so, that why it needs python version 2.x and other tools.
windows-build-tools package install required tools to build module locally. Go ahead and install this package and after installing it then try again running the command npm install command

Related

Cannot install node-sass on windows

Im trying to install node-sass. I have both python 3 and 2.7 installed along with the visual studio build tools yet node gyp still fails.
Trying to uninstall and rebuild node-sass also gives the same result. How can i fix this.
This is the command i run:
npm install node-sass
This is the error i recieve:
npm ERR! code 1
npm ERR! path C:\jsprojects\halo\node_modules\gulp-sass\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:\jsprojects\halo\node_modules\gulp-sass\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:\\jsprojects\\halo\\node_modules\\gulp-sass\\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.13.1 | 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:\jsprojects\halo\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\jsprojects\halo\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\jsprojects\halo\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\jsprojects\halo\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\jsprojects\halo\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\jsprojects\halo\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\jsprojects\halo\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\jsprojects\halo\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\jsprojects\halo\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\jsprojects\halo\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\jsprojects\halo\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\jsprojects\halo\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198: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:\Users\noble\AppData\Local\Programs\Python\Python310\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Users\noble\AppData\Local\Programs\Python\Python310\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: 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:397:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\jsprojects\\halo\\node_modules\\gulp-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\jsprojects\halo\node_modules\gulp-sass\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
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\noble\AppData\Local\npm-cache\_logs\2022-04-29T16_53_55_944Z-debug.log
You are using node version 16.13.1, I have found the solution to the decreasing the version e get the node-v14.19.2

Getting node-gyp and node-sass error in Ubuntu OS

Get this issue when doing npm install.
How to solve this issue in Ubuntu OS 20.04. I found some related stuff to solve it but all is related to window OS. Found nothing to solve this issue on Ubuntu OS. i also do sudo apt-get install node-gyp but it also giving some error. this is command is used to solve the issue on windows install --global windows-build-tools but not for Ubuntu OS.
npm ERR! code 1
npm ERR! path /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/bin/node /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/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 '/usr/bin/node',
npm ERR! gyp verb cli '/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/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#15.11.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 (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:200:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:200: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` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:200:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/mode.js:8:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:200:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
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 (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack at F (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack at E (/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:200:21)
npm ERR! gyp ERR! System Linux 5.8.0-44-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/ali/Desktop/AlfaBolt/pakistanbooking_management_portal/node_modules/node-sass
npm ERR! gyp ERR! node -v v15.11.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! /home/ali/.npm/_logs/2021-03-06T06_24_10_272Z-debug.log
Error message excerpt:
...
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
...
It looks like the error is saying that python2 is required to install this package, though I'm not sure why a node module should require python2 in 2021.
Just install python2 using the standard way to install on your machine.
For example, on Ubuntu, you might install via Terminal with:
sudo apt install python2

React modules installation fails

I'm trying to install sass-loader and node-sass via both yarn and npm , but getting the same errors .
I tried using one of these:
yarn add sass-loader#6.0.6 node-sass#4.5.3
npm install sass-loader#6.0.6 node-sass#4.5.3
But both produce similar errors. This is the response from yarn :
EDIT: I'm using windows. After setting the path of python this is the response I get:
[3/4] Linking dependencies...
warning " > react-modal#2.2.2" has incorrect peer dependency "react#^0.14.0 || ^
15.0.0".
warning " > react-modal#2.2.2" has incorrect peer dependency "react-dom#^0.14.0
|| ^15.0.0".
[4/4] Building fresh packages...
[-/2] ? waiting...
error C:\Users\sagil\Desktop\ReactTutorial\indecision-app\node_modules\node-sass
: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\sagil\Desktop\ReactTutorial\indecision-app\node_modules\node
-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Users\sagil\Desktop\ReactTutorial\
indecision-app\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass
_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Users\\sagil\\Desktop\\ReactTutorial\\indecision-app\\node_m
odules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp#3.8.0
gyp info using node#10.7.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Users\sagil\Desktop\ReactTut
orial\indecision-app\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\sagil\Desktop\ReactTutorial\indecisio
n-app\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\sagil\Desktop\ReactTutorial\indecisio
n-app\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\sagil\Desktop\ReactTutorial\indecision-a
pp\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\sagil\Desktop\ReactTutorial\indecision-a
pp\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\sagil\Desktop\ReactTutorial\indecision-a
pp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:158:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Users\sagil\Desktop\ReactTut
orial\indecision-app\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\sagil\Desktop\ReactTutorial\indecisio
n-app\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\sagil\Desktop\ReactTutorial\indecisio
n-app\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\sagil\Desktop\ReactTutorial\indecision-a
pp\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\sagil\Desktop\ReactTutorial\indecision-a
pp\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\sagil\Desktop\ReactTutorial\indecision-a
pp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:158:21)
gyp verb `which` failed stack:
gyp verb `which` failed 'Error: not found: python2\n at getNotFoundError (
C:\\Users\\sagil\\Desktop\\ReactTutorial\\indecision-app\\node_modules\\which\\w
hich.js:13:12)\n at F (C:\\Users\\sagil\\Desktop\\ReactTutorial\\indecision-a
pp\\node_modules\\which\\which.js:68:19)\n at E (C:\\Users\\sagil\\Desktop\\R
eactTutorial\\indecision-app\\node_modules\\which\\which.js:80:29)\n at C:\\U
sers\\sagil\\Desktop\\ReactTutorial\\indecision-app\\node_modules\\which\\which.
js:89:16\n at C:\\Users\\sagil\\Desktop\\ReactTutorial\\indecision-app\\node_
modules\\isexe\\index.js:42:5\n at C:\\Users\\sagil\\Desktop\\ReactTutorial\\
indecision-app\\node_modules\\isexe\\windows.js:36:5\n at FSReqWrap.oncomplet
e (fs.js:158:21)',
gyp verb `which` failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Python27\python.EXE
gyp verb check python version `C:\Python27\python.EXE -c "import sys; print "2.7
.13
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node v
ersion: 10.7.0
gyp verb command install [ '10.7.0' ]
gyp verb install input version string "10.7.0"
gyp verb install installing version: 10.7.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.7.0
gyp verb ensuring nodedir is created C:\Users\sagil\.node-gyp\10.7.0
gyp verb created nodedir C:\Users\sagil\.node-gyp\10.7.0
gyp http GET https://nodejs.org/download/release/v10.7.0/node-v10.7.0-headers.ta
r.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '10.7.0' ]
gyp verb remove using node-gyp dir: C:\Users\sagil\.node-gyp
gyp verb remove removing target version: 10.7.0
gyp verb remove removing development files for version: 10.7.0
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 104.20.22.46:443
gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1163:1
4)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sagil\\Deskto
p\\ReactTutorial\\indecision-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "reb
uild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--l
ibsass_library="
gyp ERR! cwd C:\Users\sagil\Desktop\ReactTutorial\indecision-app\node_modules\no
de-sass
gyp ERR! node -v v10.7.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this comm
I've tried downloading python 2.7 as stated in one of the errors. But the errors remains the same. I am stuck on this for 3 hours and would appreciate some help.
Could it be some permissions stuff? I don't understand why this is happening as I'm simply following a basic tutorial step by step .
It is a quite a common case that node-gyp build fails on windows.
to make the build pass, follow the steps described in the official documentation
The easiest way to make this work is by installing windows-build-tools using npm or yarn
npm install --global --production windows-build-tools
then try again to install node-sass and sass-loader
The problem can be solved too by using Bash on Ubuntu on windows
I think the error clearly states that python is not added in your environment variables or it is not even installed on the system. please resolve the python dependency and try again.
gyp verb check python checking for Python executable "python2" in the PATH

gulp-sass error when installing

I have an error that gets thrown only when I try to install gulp-sass. I have tried installing other modules, (like gulp-livereload) and they work fine. Using npm version 6.0.0. Here is the package.json section that is requiring it:
"devDependencies": {
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.2",
"gulp-imagemin": "^2.3.0",
"gulp-livereload": "^3.8.0",
"gulp-sass": "^3.0.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglifyjs": "^0.6.2",
"imagemin-pngquant": "^4.2.0"
}
The only one here that throws errors is gulp-sass. This is the error:
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp#3.6.2
gyp info using node#6.11.2 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed stack: 'Error: not found: python2\n at getNotFoundError (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:13:12)\n at F (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:68:19)\n at E (/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:80:29)\n at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/which/which.js:89:16\n at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/isexe/index.js:42:5\n at /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:123:15)',
gyp verb `which` failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.11.2
gyp verb command install [ '6.11.2' ]
gyp verb install input version string "6.11.2"
gyp verb install installing version: 6.11.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 6.11.2
gyp verb build dir attempting to create "build" dir: /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/node-sass/build'
gyp ERR! stack at Error (native)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/usr/local/bin/node" "/Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/craigbertrand/Sites/devdesktop/drupal-8/node_modules/node-sass
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Turns out this wasn't a permission problem. All I had to do was add the flag --unsafe-perm=true. I suppose it is a problem with the gulp-sass postinstaller itself, judging from this github post. Thanks vishwa for pointing out the permission denied error, I would have never found that post without it. ;)

How to resolve this sinopia installation error?

I am using redhat5.9. I found the 'make' related exception. I am wondering what are they making? I think they are just javascript relatd stuff.
[root#xxxx bin]# npm install -g sinopia --python=/usr/local/clo/ven/python-2.7.11/bin/python
> crypt3#0.1.8 install /usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/crypt3
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.2.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/crypt3/.node-gyp"
make: Entering directory `/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/crypt3/build'
CXX(target) Release/obj.target/crypt3/crypt3.o
cc1plus: error: unrecognized command line option "-std=gnu++0x"
make: *** [Release/obj.target/crypt3/crypt3.o] Error 1
make: Leaving directory `/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/crypt3/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
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 Linux 2.6.18-406.el5
gyp ERR! command "/usr/local/clo/ven/node-v4.2.3-linux-x64/bin/node" "/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/crypt3
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
> fs-ext#0.4.5 install /usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/fs-ext
> node-gyp configure build
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.2.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/fs-ext/.node-gyp"
make: Entering directory `/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/fs-ext/build'
CXX(target) Release/obj.target/fs-ext/fs-ext.o
cc1plus: error: unrecognized command line option "-std=gnu++0x"
make: *** [Release/obj.target/fs-ext/fs-ext.o] Error 1
make: Leaving directory `/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/fs-ext/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
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 Linux 2.6.18-406.el5
gyp ERR! command "/usr/local/clo/ven/node-v4.2.3-linux-x64/bin/node" "/usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/fs-ext
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing crypt3#0.1.8
npm WARN optional dep failed, continuing fs-ext#0.4.5
-
> dtrace-provider#0.4.0 install /usr/local/clo/ven/node-v4.2.3-linux-x64/lib/node_modules/sinopia/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js
First install gyp globally using sudo, then install module
sudo npm install -g gyp
sudo npm install /your module/

Categories

Resources