I wrote the basic code by using express and nuxt, as followed :
./package.json:
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start"
},
./pages/index.vue:
<template>
<p>Hello world</p>
</template>
<script>
export default {
data: () => {
return { name: 'world' }
}
}
</script>
./server.js:
// Import and Set Nuxt.js options
let config = require('../nuxt.config.js')
config.dev = !(process.env.NODE_ENV === 'production')
// Init Nuxt.js
const nuxt = new Nuxt(config)
app.use(nuxt.render)
!!!! The development environment is working normally 。 However, the deployment environment cannot be started properly !!!!! ``
Total 3 (delta 2), reused 0 (delta 0) remote: Updating branch 'master'. remote: Updating submodules. remote: Preparing deployment for commit id '38570f0049'. remote: Generating deployment script. remote: Running deployment command... remote: Handling node.js deployment. remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot' remote: Copying file: 'package.json' remote: Looking for app.js/server.js under site root. remote: Using start-up script server.js remote: Generated web.config. remote: The package.json file does not specify node.js engine version constraints. remote: The node.js application will run with the default node.js version 6.9.1. remote: Selected npm version 3.10.8 remote: Invalid start-up command "nuxt start" in package.json. Please use the format "node <script relative path>". remote: .................. remote: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): remote: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"}) remote: npm WARN nodejs-web-app@0.0.0 No repository field. remote: npm WARN nodejs-web-app@0.0.0 No license field. remote: Finished successfully. remote: Running post deployment command(s)... remote: Deployment successful.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c625">#c625</a>)</em></sub></div>