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

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

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

I cannot run any project because of gyp error. How can I fix this: npm ERR! gyp verb cli

Whenever I run my code I always get the same error. I uninstall node and npm and reinstall. But now there is no "node_modules" and I get the same error. How can I fix it?
npm ERR! code 1
npm ERR! path /Users/bng/Desktop/deneme/12-vue-spa/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /Users/bng/Desktop/deneme/12-vue-spa/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/local/bin/node',
npm ERR! gyp verb cli '/Users/bng/Desktop/deneme/12-vue-spa/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 "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (/Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /Users/bng/Desktop/deneme/12-vue-spa/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /Users/bng/Desktop/deneme/12-vue-spa/node_modules/isexe/mode.js:8: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 (/Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:13:12)
npm ERR! gyp verb `which` failed at F (/Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:68:19)
npm ERR! gyp verb `which` failed at E (/Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:80:29)
npm ERR! gyp verb `which` failed at /Users/bng/Desktop/deneme/12-vue-spa/node_modules/which/which.js:89:16
npm ERR! gyp verb `which` failed at /Users/bng/Desktop/deneme/12-vue-spa/node_modules/isexe/index.js:42:5
npm ERR! gyp verb `which` failed at /Users/bng/Desktop/deneme/12-vue-spa/node_modules/isexe/mode.js:8: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 /Users/bng/opt/anaconda3/bin/python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /Users/bng/opt/anaconda3/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: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 Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/bng/Desktop/deneme/12-vue-spa/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/bng/Desktop/deneme/12-vue-spa/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
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bng/.npm/_logs/2022-03-24T08_05_44_961Z-debug-0.log
There isn't node-sass and node-gyp. When I tried to install them I also got the same error. I cannot install anything.
I solved this problem by changing the node version to 14.15.1
Do not use node-sass anymore. Remove 'node-sass' in package.json. pls use 'dart-sass'.
https://www.npmjs.com/package/dart-sass (dart-sass is default now)
Please don't waste your time running the suggested command by others.
Please uninstall node.js and use the Node v14.x.
It will solve it automatically.
I got the same error and did this:
1. npm install node-sass
2. npm install
3. npm ci
4. ng serve --open (to launch the project ).
With most of the operating systems removing python2 this is a common issue for most projects. It definitely affected 4/5 of my recent projects after upgrading to current Linux/Debian Stable which removed python2.
The solution is for system to start using python3 and in order to do that you need to..
Solution/Solved is:
node-sass is actually at fault. Python2 is required until version 6.0.0. Normally you would upgrade to latest 7.0.3 but node-sass is currently obsolete, so we will swap to sass project.
yarn remove node-sass
yarn add sass
I've given more details on reasoning why here, or alternative dart-sass if you use "render() and renderSync() functions".:
Solved-ERR!gyp-info-using-node-gyp-3.8.0-gyp-verb-which-failed-Error-not-found-python2
Affected:
node.js /react web apps
Elixir/Phoenix assets
Android apps
Vue.js projects
The following solution works for me.
Try:
npm cache clean --force
npm uninstall node-sass
Uninstall node modules from your project
npm i sass --save
!important
i run into the same issue. ANd What I recomend to you is to install nvm to control your node version instead of unistalling the current version causing other problems with the existent projects.
NVM Installation Guide
https://www.geeksforgeeks.org/how-to-install-and-use-nvm-on-windows/
or
https://tecadmin.net/install-nvm-macos-with-homebrew/
After installation
After you are sure that you'd installed nvm successfully you can do:
nvm --version to check if nvm is successfully installed
nvm install [desired node version] ex.: nvm install 14.0.0
nvm list to check all node versions installed
nvm use [desired version] to change between node version ex.: nvm use 14.0.0
Conclusion
As I mention above, instead of unistalling your node versions you can install different versions of node and changing between then avoid future errors.
Be Happy even with bugs

Failed to install npm in project

I use Win10, x64.
Wnen I'm trying to run the command npm i, it always fails with the following error:
""""`
PS D:\Projects\work\cmdclient_frontend> npm i
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\electron',
npm WARN cleanup [Error: EBUSY: resource busy or locked, rmdir 'D:\Projects\work\cmdclient_frontend\node_modules\electron'] {
npm WARN cleanup errno: -4082,
npm WARN cleanup code: 'EBUSY',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\electron'
npm WARN cleanup }
npm WARN cleanup ],
npm WARN cleanup [
npm WARN cleanup 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\electron',
npm WARN cleanup [Error: EBUSY: resource busy or locked, rmdir 'D:\Projects\work\cmdclient_frontend\node_modules\electron'] {
npm WARN cleanup errno: -4082,
npm WARN cleanup code: 'EBUSY',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\electron'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path D:\Projects\work\cmdclient_frontend\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: D:\Progs\node.js\node.exe D:\Projects\work\cmdclient_frontend\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! ����஥��� �஥�⮢ � �⮬ �襭�� �� ������. �⮡� ������� ��ࠫ���쭮� ����஥���, ������� ��ࠬ��� "/m".
npm ERR! ����஥��� ���� 24.04.2021 14:32:17.
npm ERR! �஥�� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.sln" � 㧫� 1 (楫��� ��ꥪ�� �� 㬮�砭��).
npm ERR! ValidateSolutionConfiguration:
npm ERR! �������� ���䨣��樨 �襭�� "Release|x64".
npm ERR! �஥�� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.sln" (1) �믮���� ����஥��� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) � 㧫� 1 (楫��� ��ꥪ�� �� 㬮�砭��).
npm ERR! �஥�� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) �믮���� ����஥��� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\src\libsass.vcxproj" (3) � 㧫� 1 (楫��� ��ꥪ�� �� 㬮�砭��).
npm ERR! D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: ������஢���� �஥�� "D:\Microsoft.Cpp.Default.props" �� �����㦥�. �஢���� ���� � ������� <Import> � ����稥 䠩�� �� ��᪥.
npm ERR! ����஥��� �஥�� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\src\libsass.vcxproj" �����襭� (楫��� ��ꥪ�� �� 㬮�砭��) � �訡���.
npm ERR! ����஥��� �஥�� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.vcxproj.metaproj" �����襭� (楫��� ��ꥪ�� �� 㬮�砭��) � �訡���.
npm ERR! ����஥��� �஥�� "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.sln" �����襭� (楫��� ��ꥪ�� �� 㬮�砭��) � �訡���.
npm ERR!
npm ERR! �� 㤠���� �믮����� ����஥���.
npm ERR!
npm ERR! "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.sln" (楫���� ��ꥪ� �� 㬮�砭��) (1) ->
npm ERR! "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\binding.vcxproj.metaproj" (楫���� ��ꥪ� �� 㬮�砭��) (2) ->
npm ERR! "D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\src\libsass.vcxproj" (楫���� ��ꥪ� �� 㬮�砭��) (3) ->
npm ERR! D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: ������஢���� �஥�� "D:\Microsoft.Cpp.Default.props" �� �����㦥�. �஢���� ���� � ������� <Import> � ����稥 䠩�� �� ��᪥.
npm ERR!
npm ERR! �।�०�����: 0
npm ERR! �訡��: 1
npm ERR!
npm ERR! ����祭��� �६�: 00:00:00.08
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'D:\\Progs\\node.js\\node.exe',
npm ERR! gyp verb cli 'D:\\Projects\\work\\cmdclient_frontend\\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.0.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 "C:\Python27\python.exe" in the PATH
npm ERR! gyp verb which succeeded C:\Python27\python.exe C:\Python27\python.exe
npm ERR! gyp verb check python version C:\Python27\python.exe -c "import sys; print "2.7.18
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];" returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.0.0
npm ERR! gyp verb command install [ '16.0.0' ]
npm ERR! gyp verb install input version string "16.0.0"
npm ERR! gyp verb install installing version: 16.0.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.0.0
npm ERR! gyp verb build dir attempting to create "build" dir: D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: D:\Projects\work\cmdclient_frontend\node_modules\node-sass\build\config.gypi
npm ERR! (node:14568) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use node --trace-deprecation ... to show where the warning was created)
npm ERR! gyp verb config.gypi checking for gypi file: D:\Projects\work\cmdclient_frontend\node_modules\node-sass\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: D:\Projects\work\cmdclient_frontend\node_modules\node-sass\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'D:\\Projects\\work\\cmdclient_frontend\\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=2013',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Алекснастя\\.node-gyp\\16.0.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\\Алекснастя\\.node-gyp\\16.0.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=D:\\Projects\\work\\cmdclient_frontend\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\Алекснастя\\.node-gyp\\16.0.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=D:\\Projects\\work\\cmdclient_frontend\\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 'D:\\Projects\\work\\cmdclient_frontend\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\Алекснастя\.node-gyp\16.0.0
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb could not find "msbuild.exe" in PATH - finding location in registry
npm ERR! gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (D:\Projects\work\cmdclient_frontend\node_modules\node-gyp\lib\build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command "D:\\Progs\\node.js\\node.exe" "D:\\Projects\\work\\cmdclient_frontend\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\Projects\work\cmdclient_frontend\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.0.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\Алекснастя\AppData\Local\npm-cache\_logs\2021-04-24T07_32_19_921Z-debug.log
`""""
I've tried almost everything, but nothing works. Please, help

Everytime I Try To Run NPM Install Terminal throws several errors

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

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. ;)

Categories

Resources