-
Notifications
You must be signed in to change notification settings - Fork 1.3k
npm install failed #932
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 [email protected]: This package is no longer supported. npm warn deprecated [email protected]: 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 [email protected]: This package is deprecated. Use https://socket.dev/npm/package/eta instead. npm warn deprecated [email protected]: 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 [email protected]: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated [email protected]: This package is deprecated. Use https://socket.dev/npm/package/eta instead. npm warn deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update! npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported npm warn deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated npm warn deprecated [email protected]: this library is no longer supported npm warn deprecated [email protected]: Use String.prototype.trim() instead npm warn deprecated [email protected]: This package is no longer supported. npm warn deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated npm warn deprecated [email protected]: This package is no longer supported. npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm warn deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm warn deprecated [email protected]: 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 [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm warn deprecated [email protected]: No longer maintained. We recomment migrating to ESLint with eslint-config-wikimedia. npm warn deprecated [email protected]: Upgrade to fsevents v2 to mitigate potential security issues npm warn deprecated [email protected]: Package no longer supported. Contact [email protected] for more info. npm warn deprecated [email protected]: 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 [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm warn deprecated [email protected]: 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 [email protected]: This package is no longer supported. npm warn deprecated [email protected]: This package is no longer supported. npm warn deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm warn deprecated [email protected]: unmaintained npm warn deprecated [email protected]: support for ECMAScript is superseded by uglify-jsas of v3.13.0 npm warn deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x. npm warn deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm warn deprecated [email protected]: JSCS has merged with ESLint! See - https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2 npm warn deprecated [email protected]: Node Sass is no longer supported. Please usesassorsass-embeddedinstead. npm warn deprecated [email protected]: 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 [email protected] npm error gyp info using [email protected] | 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 verbwhichfailed Error: not found: python2 npm error gyp verbwhichfailed at getNotFoundError (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:13:12) npm error gyp verbwhichfailed at F (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:68:19) npm error gyp verbwhichfailed at E (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:80:29) npm error gyp verbwhichfailed at /Users/******/Documents/codelab/tools/site/node_modules/which/which.js:89:16 npm error gyp verbwhichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/index.js:42:5 npm error gyp verbwhichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/mode.js:8:5 npm error gyp verbwhichfailed at FSReqCallback.oncomplete (node:fs:198:21) npm error gyp verbwhichfailed python2 Error: not found: python2 npm error gyp verbwhichfailed at getNotFoundError (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:13:12) npm error gyp verbwhichfailed at F (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:68:19) npm error gyp verbwhichfailed at E (/Users/******/Documents/codelab/tools/site/node_modules/which/which.js:80:29) npm error gyp verbwhichfailed at /Users/******/Documents/codelab/tools/site/node_modules/which/which.js:89:16 npm error gyp verbwhichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/index.js:42:5 npm error gyp verbwhichfailed at /Users/******/Documents/codelab/tools/site/node_modules/isexe/mode.js:8:5 npm error gyp verbwhichfailed at FSReqCallback.oncomplete (node:fs:198:21) { npm error gyp verbwhichfailed code: 'ENOENT' npm error gyp verbwhichfailed } npm error gyp verb check python checking for Python executable "python" in the PATH npm error gyp verbwhichsucceeded python /Users/******/miniforge3/bin/python npm error (node:51002) [DEP0060] DeprecationWarning: Theutil._extendAPI is deprecated. Please use Object.assign() instead. npm error (Usenode --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