I changed nuxt js folder structure is here. I am getting Error: Couldn't find a pages directory in D:\sample. Please create one under the project root how do I access pages
.nuxt, app, node_modules, server, .eslintrc, package, package-lock
Error: Couldn't find a pages
directory in D:\sample. Please create one under the project root
You need to create a folder named pages
in order to permit nuxt to generate the routes of your app !
More information here: Routing
If you want to change the structure of the folder check this Change Directory
nuxt.config.js module.exports = { srcDir: 'client/' }
your structure:
-| app/ ---| node_modules/ ---| client/ ------| pages/ ------| components/ ---| nuxt.config.js ---| package.json
Here is the solution. On this way you don't need fake copies to make server work properly. Create and pass args to the next constructor:
// Add path module
const path = require('path')
// Init the Next app with args:
const app = next({ dir: path.join(__dirname, '..', 'yourwww'), dev })
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.