Npm run dev doesnt start up nuxt 3 local server - javascript

My Nuxt app was initially built with Nuxt2, but recently I had some errors with ESlint and I was forced to upgrade and migrate the application to Nuxt3.
However on migrating, the application local server doesn't startup with the startup script. Below is an image showing the output when running npm run dev
Nodejs : 18^
nuxtjs: 3^
vuejs: 2.7^

Nuxt3 is using Vue3, not Vue2.7.
Also, your app is fine when you run npm run dev so you don't need to run npm nuxi dev per-se.
You could run npx nuxi-edge#latest dev as suggested here.
That one works thanks to npx not npm, which is quite different. npx doesn't need you to have the package installed locally or globally on the system, it can fetch the whole code remotely and run it on the fly straight away.
Still, in your case: use npm run dev, it's all good that way.
No need to run it through npx/nuxi, that just adds delay.

Related

Vue js & node js installed. Version also showing but not starting

kirti#kirti-Vostro-14-3468:~/flipbook-vue$ node --version
v17.6.0
kirti#kirti-Vostro-14-3468:~/flipbook-vue$ vue --version
#vue/cli 5.0.1
kirti#kirti-Vostro-14-3468:~/flipbook-vue$ npm run serve
> flipbook-vue#0.10.4 serve
> vue-cli-service serve
sh: 1: vue-cli-service: not found
kirti#kirti-Vostro-14-3468:~/flipbook-vue$
System: Ubuntu 20.04
Via: Downloaded via terminal.
I'm running a GitHub repo on my system. I saw the instructions for directly running a github repo on VS Code but as it gave me this error.
I thought, to verify and install vue & node properly first and then run. But, it still gives me error. What can I do?
restart your system it may help sometime it is important to restart your system after installing nodejs

Trying to deploy Vue on Heroku

im trying hard to deploy Vue.js on herokuapp, im followed this tutorial :https://medium.com/netscape/deploying-a-vue-js-2-x-app-to-heroku-in-5-steps-tutorial-a69845ace489 but when in browse on my website it made me a some error like this :
CLI return me that :
On my package.json, i deliberately erase the build.js because i doesen't have any file named like this... it possibly that but if add this, it even worse is.
package.json :
I think that you should set your package.json scripts, so that when heroku runs npm run start to start your application, you install your application dependencies before it starts running:
npm install && node server.js

You may need an additional loader to handle the result of these loaders in NUXT app and HEROKU platform

I have a NUXT application, hosted on Heroku.
I try to deploy and suddenly I see this issue in the logs which informs me that the build failed.
I have tried to run the build script locally npm run build and it works perfectly.
Why is my code failing in the cloud but run perfectly locally?
If you don't have problems with the npm script that means that the code is fine. Taking a look back I can see that the only thing which is different is the env in which the code runs.
Most of the time the node version which you use locally is different compared with the cloud one and this might bring errors.
Find out your local node version by running node -v in the command line.
After that find out the node version in your cloud provider. In my case is Heroku and the node version is
There is clearly a difference between them.
To have the same node version running in the cloud as well, add the property engines in the package.json file and describe the node version.
This will force Heroku, to run my local version of node.js
By doing so the problem disappeared and the build was successful.

npm run build cannot access in localhost

I want to test my react/ node.js web app with a production build. I already run npm run build at the app directory and created build folder.
I was unable to run the application using localhost:8080 (server port).
Are there any ways to double check if the application is actually running in that port or access production-ready application?
PS. I used serve to host the application but it posts error 404: The requested path could not be found
Thank you for your help.
Every SPA application has its own package.json file. Inside you have to see the script section:
Normally after you run nm run build you have a compiled version of your code.
At this point, you have a see the dist folder.
After this, you can either run npm run start and you have to see
(this option is not suitable for SSR frameworks like NUXT or NEXT)
or if you don't have that option install an npm package that renders your compiled code by doing the following:
npm install -g serve
serve -s build
and you have to see

"'npm' is not recognized as an internal or external command" on create-react-app

Why is npm not recognized?
I'm trying to learn react and get started using it. I have node installed, and the package create-react-app.
If I type in my command line, npm -v or create-react-app -V, it will return the current versions I have. Which is step one in my problem.
Step two would be checking the environment paths.
I have C:\Users\hunte\AppData\Roaming\npm in my paths and I even ran my bash command line as administrator with no such luck.
Step three I assume would be restarting my computer. (Obviously it didn't work)
How I installed and tried to step up react is like this...
npm install -g create-react-app
create-react-app my-app
Then it returns 'npm' is not recognized as an internal or external command.
I'm lost, looking for some help to resolve this as I really eager to learn react.js.
Thank's to all who spend the time reading my question.
Here's my cmd
$ create-react-app test
Creating a new React app in C:\Users\hunte\desktop\test\test.
'npm' is not recognized as an internal or external command,
operable program or batch file.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
'npm' is not recognized as an internal or external command,
operable program or batch file.
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts#0.9.x has failed.
Deleting generated file... package.json
Deleting test/ from C:\Users\hunte\desktop\test
Done.
I've figured it out!
For everyone who runs into a similar problem all I did to get it to work was change CMDs.
I was using the Git Bash CMD as I like it better; however, I guess it doesn't work well with the system paths/environments.
All I did to fix this issue to run my default cmd as administrator and tried again. This time it worked and I was successful in creating the react package.
Using the default Command Prompt worked for me. I was previously working on Hyper.

Categories