npm command 'serve ' not found, although it is installed

Roland picture Roland · Apr 5, 2019 · Viewed 21.1k times · Source

I have installed serve with npm as "npm install serve -g" and also with yarn "yarn global add serve", but when I try to run "serve -s build" it says that "Command 'serve' not found.

Answer

techie_questie picture techie_questie · Apr 5, 2019

You should not install the packages globally.Try to do the following-

npm uninstall -g serve 
npm i -S serve

Let me know if this works.