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

Cannot find nodejs in Path variable on Windows Runner 22 #4125

Open
denny-snapone opened this issue Sep 12, 2024 · 1 comment
Open

Cannot find nodejs in Path variable on Windows Runner 22 #4125

denny-snapone opened this issue Sep 12, 2024 · 1 comment
Labels

Comments

@denny-snapone
Copy link

I set up a simple workflow:
- uses: actions/setup-node@v4
- name: node version
run: node -v

It then has the error:

Run node -v
node -v
shell: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE -command ". '{0}'"
Refreshing environment variables from the registry for powershell.exe. Please wait...
Finished
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\actions-runner_work_temp\ccd1c392-40b0-4647-8d9b-6d156a848202.ps1:2 char:1

  • node -v
  •   + CategoryInfo          : ObjectNotFound: (node:String) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

Error: Process completed with exit code 1.

I check the $env:Path don't have the node path.

@denny-snapone denny-snapone changed the title Cannot run find node in Path variable on Windows Runner 22 Cannot find nodejs in Path variable on Windows Runner 22 Sep 12, 2024
@stuartp44
Copy link
Collaborator

In most cases, developers should setup their environment as they require it. With this subject, typically you would install node and the version your require as part of your job. If that is not how you want to approach it, you could install it into the AMI by the use of the Packer builds. If installed correctly aka in the path as you correctly pointed out, it would be available for all jobs that run in that runner.

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

No branches or pull requests

2 participants