Help with setting up Codelab npm

81 views
Skip to first unread message

agogo...@gmail.com

unread,
Nov 1, 2024, 5:45:40 PM11/1/24
to codelab-authors
Hello,
can someone please help with this error. This is the tutorial I am following and the particular step with the error output I'm encountering. Thanks in advance.

Tutorial: https://medium.com/@zarinlo/publish-technical-tutorials-in-google-codelab-format-b07ef76972cd

Step: Once you have the project cloned, go into the site folder and install all the dependencies:
## navigate to folder
cd site/
## install dependencies
npm install
npm install -g gulp-cli



npm warn deprecated os...@0.1.5: This package is no longer supported.

npm warn deprecated infl...@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 sta...@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-...@0.4.1: See https://github.com/lydell/source-map-url#deprecated

npm warn deprecated babel-pre...@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 rim...@2.7.1: Rimraf versions prior to v4 are no longer supported

npm warn deprecated ur...@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm warn deprecated har-va...@5.1.5: this library is no longer supported

npm warn deprecated tr...@0.0.1: Use String.prototype.trim() instead

npm warn deprecated npm...@4.1.2: This package is no longer supported.

npm warn deprecated resol...@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm warn deprecated are-we-t...@1.1.7: This package is no longer supported.

npm warn deprecated gl...@7.2.3: Glob versions prior to v9 are no longer supported

npm warn deprecated gl...@5.0.15: Glob versions prior to v9 are no longer supported

npm warn deprecated source-ma...@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

npm warn deprecated gl...@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...@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

npm warn deprecated jscs-prese...@1.0.1: No longer maintained. We recomment migrating to ESLint with eslint-config-wikimedia.

npm warn deprecated fsev...@1.2.13: Upgrade to fsevents v2 to mitigate potential security issues

npm warn deprecated nom...@1.8.1: Package no longer supported. Contact sup...@npmjs.com for more info.

npm warn deprecated uu...@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...@2.2.20: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

npm warn deprecated uu...@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 ga...@2.7.4: This package is no longer supported.

npm warn deprecated fst...@1.0.12: This package is no longer supported.

npm warn deprecated req...@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm warn deprecated swig-te...@2.0.3: unmaintained

npm warn deprecated ugli...@3.3.10: support for ECMAScript is superseded by `uglify-js` as of v3.13.0

npm warn deprecated sv...@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

npm warn deprecated t...@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

npm warn deprecated js...@3.0.7: JSCS has merged with ESLint! See - https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2

npm warn deprecated node...@4.14.1: Node Sass is no longer supported. Please use `sass` or `sass-embedded` instead.

npm warn deprecated cor...@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/adijuo/go/bin/tools/site/node_modules/node-sass

npm error command failed

npm error command sh -c node scripts/build.js

npm error Building: /Users/adijuo/.nvm/versions/node/v22.11.0/bin/node /Users/adijuo/go/bin/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/adijuo/.nvm/versions/node/v22.11.0/bin/node',

npm error gyp verb cli   '/Users/adijuo/go/bin/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...@3.8.0

npm error gyp info using no...@22.11.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 `which` failed Error: not found: python2

npm error gyp verb `which` failed     at getNotFoundError (/Users/adijuo/go/bin/tools/site/node_modules/which/which.js:13:12)

npm error gyp verb `which` failed     at F (/Users/adijuo/go/bin/tools/site/node_modules/which/which.js:68:19)

npm error gyp verb `which` failed     at E (/Users/adijuo/go/bin/tools/site/node_modules/which/which.js:80:29)

npm error gyp verb `which` failed     at /Users/adijuo/go/bin/tools/site/node_modules/which/which.js:89:16

npm error gyp verb `which` failed     at /Users/adijuo/go/bin/tools/site/node_modules/isexe/index.js:42:5

npm error gyp verb `which` failed     at /Users/adijuo/go/bin/tools/site/node_modules/isexe/mode.js:8:5

npm error gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:197:21)

npm error gyp verb `which` failed  python2 Error: not found: python2

npm error gyp verb `which` failed     at getNotFoundError (/Users/adijuo/go/bin/tools/site/node_modules/which/which.js:13:12)

npm error gyp verb `which` failed     at F (/Users/adijuo/go/bin/tools/site/node_modules/which/which.js:68:19)

npm error gyp verb `which` failed     at E (/Users/adijuo/go/bin/tools/site/node_modules/which/which.js:80:29)

npm error gyp verb `which` failed     at /Users/adijuo/go/bin/tools/site/node_modules/which/which.js:89:16

npm error gyp verb `which` failed     at /Users/adijuo/go/bin/tools/site/node_modules/isexe/index.js:42:5

npm error gyp verb `which` failed     at /Users/adijuo/go/bin/tools/site/node_modules/isexe/mode.js:8:5

npm error gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:197:21) {

npm error gyp verb `which` failed   code: 'ENOENT'

npm error gyp verb `which` failed }

npm error gyp verb check python checking for Python executable "python" in the PATH

npm error gyp verb `which` succeeded python /opt/anaconda3/bin/python

npm error (node:26738) [DEP0060] DeprecationWarning: The `util._extend` API 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: /opt/anaconda3/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:419:12)

npm error gyp ERR! stack     at ChildProcess.emit (node:events:518:28)

npm error gyp ERR! stack     at maybeClose (node:internal/child_process:1104:16)

npm error gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:456:11)

npm error gyp ERR! stack     at Socket.emit (node:events:518:28)

npm error gyp ERR! stack     at Pipe.<anonymous> (node:net:343:12)

npm error gyp ERR! System Darwin 23.6.0

npm error gyp ERR! command "/Users/adijuo/.nvm/versions/node/v22.11.0/bin/node" "/Users/adijuo/go/bin/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/adijuo/go/bin/tools/site/node_modules/node-sass

npm error gyp ERR! node -v v22.11.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/adijuo/.npm/_logs/2024-11-01T21_41_47_878Z-debug-0.log

Zarin Lokhandwala

unread,
Nov 2, 2024, 1:52:52 AM11/2/24
to agogo...@gmail.com, codelab-authors
I have submitted a merge request to fix the repo, forgot to check if it has been accepted. Otherwise just clone the project from my repo: @zarinlo 

Follow the same steps using the latest codebase. 

Zarin 

--
You received this message because you are subscribed to the Google Groups "codelab-authors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codelab-autho...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/codelab-authors/23cf718c-bb02-4a89-b1c6-23dca4cf64c7n%40googlegroups.com.

agogo...@gmail.com

unread,
Nov 2, 2024, 11:51:13 AM11/2/24
to codelab-authors
I try that, but I'm still getting errors. I also installed Python 2.7 and looked around for how to fix the node error (seems that's what it is from the output), but nothing. npm install wont work in the /site directory.

Zarin Lokhandwala

unread,
Nov 2, 2024, 1:38:28 PM11/2/24
to agogo...@gmail.com, codelab-authors
I will test it today and will update my GitHub to include the exact dependency versions to make your lives easier. 

If I don’t respond by the end of the weekend, please remind me over email again. 

Zarin 

David Agogo

unread,
Nov 2, 2024, 2:53:43 PM11/2/24
to Zarin Lokhandwala, codelab-authors

Thanks a whole lot!

agogo...@gmail.com

unread,
Nov 2, 2024, 3:57:40 PM11/2/24
to codelab-authors
I used the following command to set a different version of nvm

nvm install 14.7.0  


and the steps from npm install further worked.


On Friday, November 1, 2024 at 11:52:52 PM UTC-6 Zarin Lokhandwala wrote:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages