简体   繁体   English

nuxt.js:用于运行nuxt start的.js在哪里

[英]nuxt.js: where is the .js for running nuxt start

nuxt version: 2.4.3 nuxt版本:2.4.3

I'm using node process manager (pm2) for my node.js hosting. 我正在为node.js托管使用节点进程管理器(pm2)。 To run nuxt on development server, you can simply nuxt or npm run dev but that's not the case if you're using pm2's ecosystem.config.js which needs you to specify which file actually runs that. 要在开发服务器上运行nuxt,您可以简单地nuxtnpm run dev但是如果您使用的是pm2的ecosystem.config.js nuxt ,则需要指定运行该文件的情况。

For example, to run a developement server I have to point to the file that runs it which is ./node_modules/nuxt/bin/nuxt.js 例如,要运行开发服务器,我必须指向运行它的文件,即./node_modules/nuxt/bin/nuxt.js

But I have no idea which file that run production server or nuxt start 但是我不知道哪个运行生产服务器或nuxt start

Can someone points me which file in ./node_modules/nuxt or ./node_modules/@nuxt that perform nuxt start ? 有人可以指出./node_modules/nuxt./node_modules/@nuxt中执行nuxt start哪个文件吗?

--edit This article covers how you run nuxt start with pm2 but aforementioned file ./node_modules/nuxt/bin/nuxt-start does not exists on mine. --edit 本文介绍了如何以pm2开头运行nuxt,但上述文件./node_modules/nuxt/bin/nuxt-start在我的./node_modules/nuxt/bin/nuxt-start上不存在。 I suspect because we are using different nuxt version 我怀疑是因为我们使用的是不同的nuxt版本

Js file you are looking for (nuxt > 2.3) 您要寻找的js档案(nuxt> 2.3)

node_modules/nuxt/bin/nuxt.js

When using pm2, I'm doing it this way (ecosystem.yml) 使用pm2时,我是用这种方式(ecosystem.yml)

apps:
- name: client
  script: node_modules/nuxt-start/bin/nuxt-start.js
  cwd: /root/app/client
  max_memory_restart: "250M" 
  args: "start" 

Notice that for production in this case I'm using nuxt-start dependency to speed up npm i . 请注意,在这种情况下,对于生产而言,我使用nuxt-start依赖项来加速npm i

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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