Npm install rebuilds .node-gyp upon every install - node.js

I'm getting this message upon every npm install:
> fsevents#1.2.4 install /Users/USERNAME/URL/TO/GULP/FILE/node_modules/fsevents
> node install
[fsevents] Success: "/Users/USERNAME/URL/TO/GULP/FILE/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> node-sass#3.13.1 install /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/darwin-x64-57_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> node-sass#3.13.1 postinstall /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /Users/USERNAME/URL/TO/GULP/FILE/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 [ '/usr/local/bin/node',
gyp verb cli '/Users/USERNAME/URL/TO/GULP/FILE/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.7.0
gyp info using node#8.11.1 | 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/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed stack: 'Error: not found: python2\n at getNotFoundError (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:13:12)\n at F (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:68:19)\n at E (/Users/USERNAME/URL/TO/GULP/FILE/node_modules/ which/which.js:80:29)\n at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/which/which.js:89:16\n at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/isexe/index.js:42:5\n at /Users/USERNAME/URL/TO/GULP/FILE/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:152:21)',
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: 8.11.1
gyp verb command install [ '8.11.1' ]
gyp verb install input version string "8.11.1"
gyp verb install installing version: 8.11.1
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: 8.11.1
gyp verb build dir attempting to create "build" dir: /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/USERNAME/.node-gyp/8.11.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/USERNAME/.node-gyp/8.11.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/USERNAME/.node-gyp/8.11.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/USERNAME/URL/TO/GULP/FILE/node_modules/node-sass',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/USERNAME/.node-gyp/8.11.1
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.3.6"' -I/Users/USERNAME/.node-gyp/8.11.1/include/node -I/Users/ USERNAME/.node-gyp/8.11.1/src -I/Users/USERNAME/.node-gyp/8.11.1/deps/openssl/config -I/Users/USERNAME/.node-gyp/8.11.1/deps/openssl/openssl/include -I/Users/USERNAME/.node-gyp/8.11.1/deps/uv/include -I/Users/USERNAME/.node-gyp/8.11.1/deps/zlib -I/Users/USERNAME/.node-gyp/8.11.1/deps/ v8/include -I../src/libsass/include -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
^Cmake: *** Deleting file `Release/obj.target/libsass/src/libsass/src/ast.o'
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Interrupt: 2
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN GulpFileName#1.0.0 No description
npm WARN GulpFileName#1.0.0 No repository field.
My global installed packages ( npm -g ls --depth=0 ) are these:
/usr/local/lib
├── fsevents#1.2.4
├── gulp#3.9.1
├── gulp-cli#2.0.1
├── jscs#3.0.7
├── n#2.1.8
├── node-gyp#3.7.0
├── node-sass#4.9.0
├── npm#5.10.0
└── vue-cli#2.9.3
The errors come when I run npm install with this package.json-file:
{
"name": "GulpName",
"author": "Johnny Bravo",
"version": "1.0.0",
"license": "GPL-2.0",
"dependencies": {},
"devDependencies": {
"autoprefixer": "^8.6.3",
"browserslist": "^3.2.8",
"gulp": "^4.0.0",
"gulp-concat": "^2.6.1",
"gulp-postcss": "^7.0.1",
"gulp-sass": "^2.0.0",
"gulp-clean-css": "^3.9.4",
"gulp-uglify": "^3.0.0"
},
"browserslist": [
"last 2 version",
"> 1%",
"safari >= 5",
"ie >= 8",
"chrome >= 34",
"ie_mob >= 10",
"opera >= 23",
"ios >= 7",
"ff >= 7",
"android >= 4",
"bb >= 10"
]
}
My attempts:
I tried removing ~/.node-gyp (and then refreshing the cache with npm cache verify).
I tried uninstalling all the 'random' packages I could see with npm -g ls --depth=0. I had some phantomjs and a http-server or something like that.
I tried installing node-gyp, fsevents and node-sass globally, hoping that I shouldn't go through those steps in the install-procedure. But I still get the same long error.
... And obviously I did rm -rf node_modules package-lock.json followed by npm install a bazillion times throughout my attempt of solving this.
I can see several places, something about people who gets similar errors, which is due to some yarn-thingy. I've haven't used any such thing.
Do I really have to endure this tedious and long install-procedure every time I run npm install.

Ok... I figured most of it our myself. The problem was that node-sass had version "~2.0.0", which was too old. When I bumped that up to "4.0.1", then the recompiling of node-gyp went away.
Here was my process, though - for the rookies who want to try some things themselves:
Remember that you have your local packages (in package.json) and your global packages (accessed by writing: npm -g ls --depth=0.
You can remove all of your global packages, by following this answer.
Then remove your devDependencies one at the time, and try running npm install until the stupid error goes away.
I'm still getting this error (which I wont solve, since I decreased my npm install-time by a minute or so, which is enough for me).
> fsevents#1.2.4 install /PATH/TO/PACKAGEJSON-FILE/node_modules/fsevents
> node install
[fsevents] Success: "/PATH/TO/PACKAGEJSON-FILE/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> node-sass#4.9.0 install /PATH/TO/PACKAGEJSON-FILE/node_modules/node-sass
> node scripts/install.js
Cached binary found at /Users/REDACTED/.npm/node-sass/4.9.0/darwin-x64-57_binding.node
> node-sass#4.9.0 postinstall /PATH/TO/PACKAGEJSON-FILE/node_modules/node-sass
> node scripts/build.js
Binary found at /PATH/TO/PACKAGEJSON-FILE/node_modules/node-sass/vendor/darwin-x64-57/binding.node
Testing binary
Binary is fine

so spent few hours with similar problem. tried with installed node v19,v18,v16 and all other tries like reinstall python node-gyp versions ... solution was to set node v14 and npm install fixed everything!

Related

Every time i try to install a new package i get gyp err syntax error

I was installing firebase, before this I tried installing yarn add react-router-dom, this same thing happened I had to create new project and copy all files again to new project , one thing I noticed
was this happened after adding the project to github, before I added the project to the github repository, if i installed any packages, I didn't get any error,
$ yarn add firebase
yarn add v1.22.5
[1/4] Resolving packages...
warning node-sass > node-gyp > request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
[2/4] Fetching packages...
info fsevents#2.3.1: The platform "win32" is incompatible with this module.
info "fsevents#2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "win32" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.2.1: The platform "win32" is incompatible with this module.
info "fsevents#2.2.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.1.3: The platform "win32" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > #testing-library/user-event#12.6.0" has unmet peer dependency "#testing-library/dom#>=7.21.4".
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" has unmet peer dependency "typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
[1/4] ⠄ node-sass
[-/4] ⠄ waiting...
[-/4] ⡀ waiting...
error C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\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 [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Users\\Muhammad\\Desktop\\React projects\\szone-shoppee-project\\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 verb cli ]
gyp info using node-gyp#3.8.0
gyp info using node#15.5.1 | 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\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\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 (C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\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:\Python38\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python38\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.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Muhammad\\Desktop\\React projects\\szone-shoppee-project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Muhammad\Desktop\React projects\szone-shoppee-project\node_modules\node-sass
gyp ERR! node -v v15.5.1
gyp ERR! node-gyp -v v3.8.0
You can do either of these two things.
Downgrade Python to 2.x.
Install the packages using npm install --ignore-scripts
NOTE: This will cause npm to stop running scripts defined in the package.json

Yarn install fail with node-sass / node-modules

Rails app
Updating yarn with homebrew to yarn v1.22.10 but then yarn install fail with this error :
yarn install v1.22.10
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning " > webpack-dev-server#3.11.0" has unmet peer dependency "webpack#^4.0.0 || ^5.0.0".
warning "webpack-dev-server > webpack-dev-middleware#3.7.2" has unmet peer dependency "webpack#^4.0.0".
[4/4] 🔨 Building fresh packages...
[-/3] ⠈ waiting...
[-/3] ⠈ waiting...
error /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass
Output:
Building: /usr/local/Cellar/node/15.1.0/bin/node /Users/eliseserres/code/Septlieues/intranet/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 [
gyp verb cli '/usr/local/Cellar/node/15.1.0/bin/node',
gyp verb cli '/Users/eliseserres/code/Septlieues/intranet/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 verb cli ]
gyp info using node-gyp#3.8.0
gyp info using node#15.1.0 | 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 "/usr/bin/python" in the PATH
gyp verb `which` succeeded /usr/bin/python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import sys; print "2.7.16
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 version: 15.1.0
gyp verb command install [ '15.1.0' ]
gyp verb install input version string "15.1.0"
gyp verb install installing version: 15.1.0
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: 15.1.0
gyp verb build dir attempting to create "build" dir: /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/Users/eliseserres/code/Septlieues/intranet/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/eliseserres/code/Septlieues/intranet/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/eliseserres/.node-gyp/15.1.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/eliseserres/.node-gyp/15.1.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/eliseserres/code/Septlieues/intranet/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/eliseserres/.node-gyp/15.1.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/eliseserres/code/Septlieues/intranet/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (node:events:327:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node/15.1.0/bin/node" "/Users/eliseserres/code/Septlieues/intranet/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/eliseserres/code/Septlieues/intranet/node_modules/node-sass
gyp ERR! node -v v15.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Trying to update node-sass but yarn add node-sass fail with same error.
node -v -> node v15.1.0
Does someone know what can I do ?
According to this you may have to reinstall Xcode Command-line Tools and then configure node-gyp after that. I suggest you follow this tutorial as it is from the official Node.js developers.
Only node-sass v5 supports Node 15. Since I see webpack included you may be running into the same incompatibility with sass-loader as https://stackoverflow.com/a/64653160/455535

How do I make npm install work when it can't find my python installation?

npm install fails and my goal is to get it to succeed.
I have Python 2 installed, but it is located at /usr/bin/python2 and not /usr/local/bin/python2.
I get the following error message when running npm install.
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 verb cli ]
gyp info using node-gyp#3.8.0
gyp info using node#14.2.0 | 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 "/usr/local/bin/python2" in the PATH
gyp verb `which` failed Error: not found: /usr/local/bin/python2
What should I do about it?
One of the simplest things you can try is a symlink from the actual location of the python2 executable to the location where npm is expecting it.
# create symlink
ln -s /usr/bin/python2 /usr/local/bin/python2
# test executability of symlink
/usr/local/bin/python2 --version
Once you've created that symlink, retry npm install in your project.

Failed to create ionic project?

This Errors are occurring when I going to create a project.
C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error
MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the
declaration is correct, and that the file exists on disk.
PS C:\Users\Tareque\Desktop\ionic apps> ionic start app blank
√ Creating directory .\app - done!
√ Downloading and extracting blank starter - done!
? Would you like to integrate your new app with Cordova to target native iOS and Android? Yes
√ Personalizing ionic.config.json and package.json - done!
> ionic integrations enable cordova --quiet
√ Downloading integration cordova - done!
√ Copying integrations files to project - done!
[OK] Added cordova integration!
Installing dependencies may take several minutes.
* IONIC DEVAPP *
Speed up development with the Ionic DevApp, our fast, on-device testing mobile app
- Test on iOS and Android without Native SDKs
- LiveReload for instant style and JS updates
️--> Install DevApp <--
> npm i
× Running command - failed!
[ERROR] An error occurred while running npm i (exit code 1):
> node-sass#4.7.2 install C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/win32-x64-64_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.7.2/win32-x64-64_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> uglifyjs-webpack-plugin#0.4.6 postinstall C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
> node-sass#4.7.2 postinstall C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass
> node scripts/build.js
Building: C:\Program Files\nodejs\node.exe C:\Users\Tareque\Desktop\ionic
apps\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\\Tareque\\Desktop\\ionic apps\\app\\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#10.0.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
"C:\Users\Tareque\AppData\Local\Programs\Python\Python36-32\python.exe" in the PATH
gyp verb `which` succeeded C:\Users\Tareque\AppData\Local\Programs\Python\Python36-32\python.exe
C:\Users\Tareque\AppData\Local\Programs\Python\Python36-32\python.exe
gyp verb check python version `C:\Users\Tareque\AppData\Local\Programs\Python\Python36-32\python.exe -c "import
platform; print(platform.python_version());"` returned: "3.6.4\r\n"
gyp verb could not find "C:\Users\Tareque\AppData\Local\Programs\Python\Python36-32\python.exe". checking python
launcher
gyp verb check python launcher python executable found: "C:\\Python27\\python.exe"
gyp verb check python version `C:\Python27\python.exe -c "import platform; print(platform.python_version());"`
returned: "2.7.15\r\n"
gyp verb get node dir no --target version specified, falling back to host node version: 10.0.0
gyp verb command install [ '10.0.0' ]
gyp verb install input version string "10.0.0"
gyp verb install installing version: 10.0.0
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: 10.0.0
gyp verb build dir attempting to create "build" dir: C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-sass\build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-sass\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\Tareque\\Desktop\\ionic apps\\app\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2013',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Tareque\\Desktop\\ionic
apps\\app\\node_modules\\node-sass\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Tareque\\Desktop\\ionic apps\\app\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Tareque\\.node-gyp\\10.0.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\Tareque\\.node-gyp\\10.0.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Tareque\\Desktop\\ionic apps\\app\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\Tareque\\.node-gyp\\10.0.0\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Tareque\\Desktop\\ionic apps\\app\\node_modules\\node-sass', gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\Tareque\\Desktop\\ionic apps\\app\\node_modules\\node-sass\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\Tareque\.node-gyp\10.0.0
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 5/8/2018 2:52:56 PM.
Project "C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.sln" on node 1 (default
targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|x64".
Project "C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.sln" (1) is building
"C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) on node 1
(default targets).
Project "C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) is
building "C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\src\libsass.vcxproj" (3) on node
1 (default targets).
C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019:
The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import>
declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\src\libsass.vcxproj"
(default targets) -- FAILED.
Done Building Project "C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-sass\build\binding.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.sln"
(default targets) -- FAILED.
Build FAILED.
"C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.sln" (default target) (1) ->
"C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target)
(2) ->
"C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\src\libsass.vcxproj" (default target) (3)
->
C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error
MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the
<Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.63
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Tareque\Desktop\ionic
apps\app\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Tareque\\Desktop\\ionic
apps\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags="
"--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Tareque\Desktop\ionic apps\app\node_modules\node-sass
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.3: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Tareque\AppData\Roaming\npm-cache\_logs\2018-05-08T08_52_57_968Z-debug.log
I have changed the environment variable many time after that errors start occurring. Then I install python and set the environment variable and installed visual studio to resolve windows build error . Now it is working fine..

Angular2 applicatoin node-sass install error

My application was running fine but all of sudden showing the following error when i try npm i. my node version is: v6.10.3 and npm version: 3.10.10
npm WARN prefer global node-gyp#3.6.2 should be installed with -g
> node-sass#4.7.1 install C:\Projects\Latest_Nov20\FrontEnd\OdyssEY-UI-Core\node_modules\node-sass
> node scripts/install.js
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Users\\2024522\\AppData\\Roaming\\npm\\node_modules\\node-sass\\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.10.3 | 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\2024522\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\2024522\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\2024522\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\2024522\AppData\Roaming\npm\node_modules\node-sass\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\2024522\AppData\Roaming\npm\node_modules\node-sass\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\2024522\AppData\Roaming\npm\node_modules\node-sass\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed python2 { Error: not found: python2
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.1/win32-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.7.1/win32-x64-48_binding.node":
tunneling socket could not be established, cause=getaddrinfo ENOTFOUND empweb2.ey.net empweb2.ey.net:80
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> node-sass#4.7.1 postinstall C:\Projects\Latest_Nov20\FrontEnd\OdyssEY-UI-Core\node_modules\node-sass
> node scripts/build.js
I was trying installing nvm and uninstalled nvm. only after this, i am getting this error.
Can anyone help me what am i doing wrong here?
Thanks
I have faced and fixed this issue relates node-sass and python error.Try installing latest angular cli command with the steps below
Set the system variable path as well:
C:\Users\windowsusername\AppData\Roaming\npm
C:\Users\windowsusername\AppData\Roaming\npm\node_modules\#angular\cli\bin;
C:\Program Files\nodejs;
Then start using angular cli command prompt using:
angular client project folder path>npm install -g #angular/cli#latest
angular client project folder path>npm install -g node-gyp

Resources