React serve: The term ‘serve’ is not recognized as the name of a cmdlet

Issue Description

After setting up React pre-requisites properly serve -s build commands still gives below error,

serve : The term ‘serve’ 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.

React serve The term serve is not recognized as the name of a cmdlet

Resolution

To resolve the issue , i had to reinstall the serve package as below,

npm install -g serve

Before doing that all i did was uninstalled existing version

npm uninstall -g serve

If you still get an error please try installing it using below command,

npm i -S serve

After applying the above fix, I was able to run the command without any issue locally and on the build server.

React serve The term serve is not recognized as the name of a cmdlet

I was also able to see serve package in the folder (If using Windows)

%USERPROFILE%\AppData\Roaming\npm\node_modules

React serve The term serve is not recognized as the name of a cmdlet

Did the above steps resolve your issue? Please sound off your comments below!

Happy Coding !!

Reference :

Do you have any comments or ideas or any better suggestions to share?

Please sound off your comments below.

Happy Coding !!



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



Leave a Reply

Your email address will not be published. Required fields are marked *