soarinblue
soarinblue

Reputation: 1687

nuxt js build locally, and run on server of the production

I build the project of nuxt js locally, i.e., npm run build, and push the project with .nuxt folder, but not the folder of node_modules. Then run the command of npm run start, failed.

The output info: sh: nuxt: command not found

Why?

Upvotes: 3

Views: 7286

Answers (1)

Nicolas Pennec
Nicolas Pennec

Reputation: 7631

npm run start will run the script from package.json:

"scripts": {
    "start": "nuxt start",
    ...
}

it's an alias to run node_modules/nuxt/bin/nuxt start

so the node_modules/ folder is mandatory.

Upvotes: 5

Related Questions