Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Andrew Whatmore
Full Stack JavaScript Techdegree Student 9,793 PointsError with heroku open
Hi,
I'm trying to run the 'heroku open' command. I'm using WSL2 in Windows 11. They haven't played well together at all!
I am actually able to open the app using the link that heroku open creates. But heroku open itself doesn't open it, and it creates the following error message. I would like to fix it because I have had a lot of problems getting it working and would like to make sure there aren't underlying issues which could create future problems.
Error message
The error message in WSL terminal is as follows:
node:events:497
throw er; // Unhandled 'error' event
^
Error: spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe EACCES
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:89:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:89:21) {
errno: -13,
code: 'EACCES',
syscall: 'spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
path: '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Bypass',
'-EncodedCommand',
Logs
This was the top part of the logs when I ran 'heroku logs --tail':
2026-04-04T12:25:54.630313+00:00 app[web.1]: > node app.js
2026-04-04T12:25:54.630314+00:00 app[web.1]:
2026-04-04T12:25:54.721327+00:00 app[web.1]: The application is running on localhost:3000.
2026-04-04T12:26:53.864332+00:00 heroku[web.1]: Stopping process with SIGKILL
2026-04-04T12:26:53.930445+00:00 heroku[web.1]: Process exited with status 137
2026-04-04T12:26:53.958229+00:00 heroku[web.1]: State changed from starting to crashed
2026-04-04T12:34:43.998113+00:00 app[api]: Log session created by user wjboff@hotmail.co.uk
2026-04-04T12:38:16.000000+00:00 app[api]: Build started by user wjboff@hotmail.co.uk
2026-04-04T12:38:33.000000+00:00 app[api]: Build succeeded
2026-04-04T12:38:33.512575+00:00 app[api]: Deploy afad42b9 by user wjboff@hotmail.co.uk
2026-04-04T12:38:33.512575+00:00 app[api]: Release v6 created by user wjboff@hotmail.co.uk
2026-04-04T12:38:34.077002+00:00 heroku[web.1]: State changed from crashed to starting
2026-04-04T12:38:36.839466+00:00 heroku[web.1]: Starting process with command `npm start`
2026-04-04T12:38:37.864527+00:00 app[web.1]:
2026-04-04T12:38:37.864548+00:00 app[web.1]: > flashcards@1.0.0 start
2026-04-04T12:38:37.864549+00:00 app[web.1]: > node app.js
2026-04-04T12:38:37.864550+00:00 app[web.1]:
2026-04-04T12:38:37.967778+00:00 app[web.1]: The application is running on localhost:3000.
2026-04-04T12:38:37.997509+00:00 heroku[web.1]: State changed from starting to up
Many thanks in advance for anyone's help!
2 Answers
Travis Alstrand
Treehouse TeacherHiya Andrew Whatmore ! 👋
I'm so sorry this post was missed somehow! My apologies. I figured I'd still reply just in case you never figured it out or if someone else sees this looking for an answer as well. After some looking around and trying my best to come up with something for you I reviewed your app.js and your Heroku port configuration looks correct. The application is listening on process.env.PORT, which is what Heroku requires.
The heroku open error appears unrelated to your application code. The error message indicates that the Heroku CLI is trying to launch Windows PowerShell from within WSL2 and is receiving an EACCES (permission denied) error:
Error: spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe EACCES
Since:
-
heroku opensuccessfully generates the correct URL, - the URL works when opened manually,
- and Heroku reports the app as "up",
this seems like a WSL2 / Windows integration issue rather than a problem with your app or deployment.
As a quick test, maybe try running:
powershell.exe
from your WSL terminal. If that also throws a permission error, then the issue is with WSL's ability to execute Windows programs rather than with Heroku.
In this case, it's generally safe to continue using the app and manually open the URL when needed.
Andrew Whatmore
Full Stack JavaScript Techdegree Student 9,793 PointsHi Travis, thanks for the response.
I ran the command, and received this response:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
I actually un-subscribed from Heroku a couple of weeks ago as it was charging me more than I thought, so not sure I'd be able to test it again.
Thanks,
Andrew
Andrew Whatmore
Full Stack JavaScript Techdegree Student 9,793 PointsAndrew Whatmore
Full Stack JavaScript Techdegree Student 9,793 PointsAnd this is the nodeJS app I'm running on Heroku - this is the GitHub link:
https://github.com/hagbeb/flashcards