Trying to deploy Vue on Heroku - javascript

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

Related

Npm run dev doesnt start up nuxt 3 local server

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.

This dependency was not found

When i try to npm run serve it stops at 98% and :
ERROR
Failed to compile with 1 error
This dependency was not found:
* #/components/HelloWorld.vue in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Home.vue?vue&type=script&lang=js
To install it, you can run: npm install --save #/components/HelloWorld.vue
I looked up for some sources but never helped. Even installing HelloWorld.vue turns an error.
It looks like one of your files is trying to load a local component called HelloWorld.vue and it may not exist in your project structure. You shouldn't try to "install" it, but rather head to the Home.vue file where this error is being triggered from (see Home.vue at th end of the error message?). Then ask yourself, do you actually want to load HelloWorld.vue?
I imagine you're following some sort of "getting started with Vue" guide and you've been instructed to include that file. You'll have to either create that file in the {YOUR_PROJECT}/src/components/ folder, or remove the code that's trying to load it.
Alternatively, this could be a configuration error in which you're trying to use the # alias but it hasn't been setup in webpack properly. Please include more info if this doesn't solve your problem.
Maybe Vue Js cli is not installed on server
// to install vue on ubuntu
npm install -g #vue/cli
// check if it was installed successfully
vue --version
#vue/cli 4.1.2

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.

error installing/running Meteor with MySQL

I have installed Meteorite on my mac, and am trying to run the test program provided as a mysql project. When I use the command 'mrt', I get:
Stand back while Meteorite does its thing
Done installing smart packages
Ok, everything's ready. Here comes Meteor!
[[[[[ /Users/lfrey/Desktop/Thesis/test-meteor-sql ]]]]]
=> Errors prevented startup:
While building the application:
node_modules/meteor/app/lib/unsupported.html:1: Can't set DOCTYPE here. (Meteor sets for you)
node_modules/meteor/app/meteor/meteor.js:1:15: Unexpected token ILLEGAL
=> Your application has errors. Waiting for file change.
I have tried re-installing nom, meteor, meteorite, and mysql in various combinations and have not been able to eliminate the error. If I remove the command, then I get an error about invalid HTML syntax.
Your app might not be created properly. You have a node_modules directory in your application which you might have added with npm install.
Meteor does not install modules with npm install manually, it doesn't work because it parses files in the node_moules directory as part of your meteor app (in the wrong way - not as an npm module).
You have to make sure the package you use uses Npm.depends in your package's package.js. The standard Meteor-SQL package already does this for you so you don't have to worry about it.
Which SQL package did you use? As far as I can see none of them install anything with npm install nor do they have instructions to.
The simple fix to get your app working is to remove the modules you installed by deleting the node_modules directory in your app.

Categories