简体   繁体   中英

Node and npm with FTP

I have an issue with my application(a chatbot made with Vite/Node.js). When I run the command: npm run dev in the terminal inside vscode, I can open the localhost and use the application. But when I try to upload the files to my ftp server, and then open the website to run the applicaton, it does not work. I have looked for hours, and found out that the reason for this issue, is that my ftp server, does not have node.js and npm installed. So I guess my question is. How do I install node.js and npm on my ftp server, so that I am able to run this "npm run dev" command on the server? Btw, I am a beginner developer, with under 1 year of experience.

This is a pretty board question. But as you have discovered you can not use node on websites that are statically hosted. You can only use javascript, CSS, and HTML.

If you want to have a server, node running with a framework like express, then you need to host the server. But that is a giant topic, you could google it; there are many ways to host a back end service that is running node. (for instance an EC2 container on AWS)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM