nuxt js 在本地构建,并在生产服务器上运行

soa*_*lue 3 nuxt.js

我在本地构建 nuxt js 项目,即 ,npm run build并使用 .nuxt 文件夹推送该项目,但不使用 node_modules 文件夹。然后运行命令npm run start,失败。

输出信息: sh: nuxt: 命令未找到

为什么?

Nic*_*nec 5

npm run start将从以下位置运行脚本package.json

"scripts": {
    "start": "nuxt start",
    ...
}
Run Code Online (Sandbox Code Playgroud)

这是要运行的别名node_modules/nuxt/bin/nuxt start

所以该node_modules/文件夹是强制性的。