linuxnpmserve

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


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.


Solution

  • 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.