Error: No build files found, please run `nuxt build` before launching `nuxt start

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Error: No build files found, please run `nuxt build` before launching `nuxt start



I created a nuxt boilerplate using



vue-cli nuxt-community/starter-template



I also created another using



create-nuxt-app



. They both create my boilerplate properly. But anytime i try to build start my projects using



yarn start



I get this error:



Error: No build files found, please run nuxt build before launching
`nuxt start


nuxt build



furthermore, whenever i run



nuxt build



I get this:



No command 'nuxt' found, did you mean: Command 'next' from package
'nmh' (universe) nuxt: command not found



but when i run



yarn build



it builds and running yarn start a second time works but without hot module reloading. I don't know what the problem is. I don't know whether my yarn is broken or nuxt. Please help!




1 Answer
1



nuxt build does not work from your command line, because you have not added it to your PATH variable. npm run build will look in your dependencies and use that instead.


nuxt build


PATH


npm run build



To get a dev server running, use npm run dev. I believe by default it will start a dev server with live reload on port 3000. To build for production, use npm run build and npm run start.


npm run dev


npm run build


npm run start





thanks, i noticed that npm run dev, npm run build and npm run start work properly, but how do i fix this issue with yarn so that i can use yarn instead of npm. i want to run yarn start successfully.
– Teddy McZieuwa
Aug 12 at 13:49






@TeddyMcZieuwa yarn will work same as npm
– Aldarund
Aug 12 at 16:51





@TeddyMcZieuwa yarn is a program built upon npm. If I remember correctly, you can use both yarn run dev or yarn dev, yarn run build or yarn build and yarn run start or yarn start. It executes scripts as defined in the package.json file.
– Sumurai8
Aug 12 at 17:37


npm


yarn run dev


yarn dev


yarn run build


yarn build


yarn run start


yarn start





I know, it works well with npm but whenever i use yarn, i get the errors stated above. I am confused.
– Teddy McZieuwa
Aug 12 at 20:47





Thanks for the help guys, it was a little problem with my linux. I ran sudo apt upgrade and sudo apt update. This fixed the issue. It had nothing to do with nuxt.
– Teddy McZieuwa
Aug 24 at 22:04






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard