-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
My computer specs:
chip:Apple M1 Pro
macOS: Sequoia 15.5
go version: go version go1.24.3 darwin/arm64
npm -v: 10.9.2
node -v:v22.16.0
follow the doc, "https://github.com/googlecodelabs/tools/tree/main/site" after "cd site"
when i run "npm install", there is an error:
npm error gyp verb which
failed Error: not found: python2
Because my mac is using M1, so it can't install python2
These are detail of the log:
npm install npm warn deprecated osenv@0.1.5: This package is no longer supported. npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated lodash.template@2.4.1: This package is deprecated. Use https://socket.dev/npm/package/eta instead. npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated lodash.template@3.6.2: This package is deprecated. Use https://socket.dev/npm/package/eta instead. npm warn deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update! npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm warn deprecated har-validator@5.1.5: this library is no longer supported npm warn deprecated trim@0.0.1: Use String.prototype.trim() instead npm warn deprecated npmlog@4.1.2: This package is no longer supported. npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported. npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@5.0.15: Glob versions prior to v9 are no longer supported npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. npm warn deprecated npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) npm warn deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm warn deprecated jscs-preset-wikimedia@1.0.1: No longer maintained. We recomment migrating to ESLint with eslint-config-wikimedia. npm warn deprecated fsevents@1.2.13: Upgrade to fsevents v2 to mitigate potential security issues npm warn deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info. npm warn deprecated uuid@2.0.3: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated gulp-util@2.2.20: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated gauge@2.7.4: This package is no longer supported. npm warn deprecated fstream@1.0.12: This package is no longer supported. npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm warn deprecated swig-templates@2.0.3: unmaintained npm warn deprecated uglify-es@3.3.10: support for ECMAScript is superseded by
uglify-jsas of v3.13.0 npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm warn deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm warn deprecated jscs@3.0.7: JSCS has merged with ESLint! See - https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2 npm warn deprecated node-sass@4.14.1: Node Sass is no longer supported. Please use
sassor
sass-embeddedinstead. npm warn deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm error code 1 npm error path /Users/******/Documents/codelab/tools/site/node_modules/node-sass npm error command failed npm error command sh -c node scripts/build.js npm error Building: /Users/******/.nvm/versions/node/v22.16.0/bin/node /Users/******/Documents/codelab/tools/site/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= npm error gyp info it worked if it ends with ok npm error gyp verb cli [ npm error gyp verb cli '/Users/******/.nvm/versions/node/v22.16.0/bin/node', npm error gyp verb cli '/Users/******/Documents/codelab/tools/site/node_modules/node-gyp/bin/node-gyp.js', npm error gyp verb cli 'rebuild', npm error gyp verb cli '--verbose', npm error gyp verb cli '--libsass_ext=', npm error gyp verb cli '--libsass_cflags=', npm error gyp verb cli '--libsass_ldflags=', npm error gyp verb cli '--libsass_library=' npm error gyp verb cli ] npm error gyp info using node-gyp@3.8.0 npm error gyp info using node@22.16.0 | darwin | arm64 npm error gyp verb command rebuild [] npm error gyp verb command clean [] npm error gyp verb clean removing "build" directory npm error gyp verb command configure [] npm error gyp verb check python checking for Python executable "python2" in the PATH npm error gyp verb
whichfailed Error: not found: python2 npm error gyp verb
whichfailed at getNotFoundError (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:13:12) npm error gyp verb
whichfailed at F (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:68:19) npm error gyp verb
whichfailed at E (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:80:29) npm error gyp verb
whichfailed at /Users/******/Documents/codelab/tools/site/node_modules/which/which.js:89:16 npm error gyp verb
whichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/index.js:42:5 npm error gyp verb
whichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/mode.js:8:5 npm error gyp verb
whichfailed at FSReqCallback.oncomplete (node:fs:198:21) npm error gyp verb
whichfailed python2 Error: not found: python2 npm error gyp verb
whichfailed at getNotFoundError (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:13:12) npm error gyp verb
whichfailed at F (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:68:19) npm error gyp verb
whichfailed at E (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:80:29) npm error gyp verb
whichfailed at /Users/******/Documents/codelab/tools/site/node_modules/which/which.js:89:16 npm error gyp verb
whichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/index.js:42:5 npm error gyp verb
whichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/mode.js:8:5 npm error gyp verb
whichfailed at FSReqCallback.oncomplete (node:fs:198:21) { npm error gyp verb
whichfailed code: 'ENOENT' npm error gyp verb
whichfailed } npm error gyp verb check python checking for Python executable "python" in the PATH npm error gyp verb
whichsucceeded python /Users/******/miniforge3/bin/python npm error (node:51002) [DEP0060] DeprecationWarning: The
util._extendAPI is deprecated. Please use Object.assign() instead. npm error (Use
node --trace-deprecation ...to show where the warning was created) npm error gyp ERR! configure error npm error gyp ERR! stack Error: Command failed: /Users/******/miniforge3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3]; npm error gyp ERR! stack File "<string>", line 1 npm error gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; npm error gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ npm error gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? npm error gyp ERR! stack npm error gyp ERR! stack at genericNodeError (node:internal/errors:983:15) npm error gyp ERR! stack at wrappedFn (node:internal/errors:537:14) npm error gyp ERR! stack at ChildProcess.exithandler (node:child_process:414:12) npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28) npm error gyp ERR! stack at maybeClose (node:internal/child_process:1101:16) npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5) npm error gyp ERR! System Darwin 24.5.0 npm error gyp ERR! command "/Users/******/.nvm/versions/node/v22.16.0/bin/node" "/Users/******/Documents/codelab/tools/site/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" npm error gyp ERR! cwd /Users/******/Documents/codelab/tools/site/node_modules/node-sass npm error gyp ERR! node -v v22.16.0 npm error gyp ERR! node-gyp -v v3.8.0 npm error gyp ERR! not ok npm error Build failed with error code: 1 npm error A complete log of this run can be found in: /Users/******/.npm/_logs/2025-05-28T20_32_25_457Z-debug-0.log (base) ******@Hanlus-MacBook-Pro site % python --version Python 3.12.10