Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project's gulp should run with Node.js 10 version #1943

Open
smallmain opened this issue Nov 14, 2024 · 6 comments
Open

Project's gulp should run with Node.js 10 version #1943

smallmain opened this issue Nov 14, 2024 · 6 comments

Comments

@smallmain
Copy link

image
  • Since gulp needs to run with the old version of node, errors will not occur.
  • I fixed node version to 10 in this project.
  • gulp is installed globally and within this project.
  • After running gulp, the node version number used will be printed. You can see that if you do not use --node to explicitly specify the version number, the global version 20 will be used.

If gulp is installed in the project, the gulp version in the project should be used first, and the same is true for node.

@smallmain smallmain changed the title project's gulp should run with Node.js 10 version. Project's gulp should run with Node.js 10 version. Nov 14, 2024
@smallmain smallmain changed the title Project's gulp should run with Node.js 10 version. Project's gulp should run with Node.js 10 version Nov 14, 2024
@rwjblue
Copy link
Contributor

rwjblue commented Nov 14, 2024

When using a globally installed package from volta which gulp should not be resolving to cocos-service-pack/src/node_modules/.bin/gulp, it should be found at ~/.volta/bin/gulp.

Some questions to figure out what is going on here:

  • Can you run ~/.volta/bin/gulp tttt?
  • How did you install gulp globally (what command did you run)?
  • Can you echo $PATH from cocos-service-pack/src/engine?
  • Can you run which -a gulp from cocos-service-pack/src/engine?
  • What are you using to add node_modules/.bin to your $PATH? Normally from within a repo, you cannot which foo and have it resolved from ./node_modules/.bin/, so it seems that something is adding ./node_modules/.bin to $PATH.

@smallmain
Copy link
Author

smallmain commented Nov 14, 2024

@rwjblue

  • Can run normally, version is v22.11.0
  • I run npm i -g [email protected]
  • PATH: /Users/smallmain/.console-ninja/.bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Users/smallmain/.bun/bin:/Users/smallmain/.volta/bin
  • The result is: /Users/smallmain/.volta/bin/gulp
  • I didn't add it, the command I ran was volta which gulp and what it returned was /Users/smallmain/Documents/Work/cocos-service-pack-src/engine/node_modules/.bin/gulp

@smallmain
Copy link
Author

If the correct behavior is to execute the globally installed gulp no matter what, how do I solve this problem when a project relies on older versions of gulp and node ?

@rwjblue
Copy link
Contributor

rwjblue commented Nov 16, 2024

If the correct behavior is to execute the globally installed gulp no matter what

This is not the correct behavior. Take a look at this blog post that explains how Volta works RE: globals:

https://blog.volta.sh/2019/06/18/global-installs-done-right/

@smallmain
Copy link
Author

If the correct behavior is to execute the globally installed gulp no matter what

This is not the correct behavior. Take a look at this blog post that explains how Volta works RE: globals:

https://blog.volta.sh/2019/06/18/global-installs-done-right/

Alright, so now it's indeed running correctly in the gulp project, but Node is not using the locked version of Node specified in the project.

@rwjblue
Copy link
Contributor

rwjblue commented Nov 17, 2024

Probably the best thing to debug this further is to make a new temp / sandbox project and start porting things over until you can replicate the issue. That should help narrow things down for you a bunch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants