Couldn't find a `pages` directory. nextjs
up vote
0
down vote
favorite
I do everything according to the instructions https://nextjs.org/learn/basics/getting-started/setup
I run npm run dev
And displays an error
Div-Man@DivMan MINGW64 /f/nextjs/hello-next
$ npm run dev
> hello-next@1.0.0 dev F:nextjshello-next
> next
> Couldn't find a `pages` directory. Please create one under the project root
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 dev: `next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T07_58_57_773Z-debug.log
$ node -v
v10.6.0
$ npm -v
6.1.0
windows 8.1
package.json
{
"name": "hello-next",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"dev": "next",
"build": "next build",
"start": "next start"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"next": "^7.0.2",
"react": "^16.6.1",
"react-dom": "^16.6.1"
}
}
npm start
> hello-next@1.0.0 start F:nextjshello-next
> next start
Error: Could not find a valid build in the 'F:nextjshello-next.next' director y! Try building your app with 'next build' before starting the server.
at Server.readBuildId (F:nextjshello-nextnode_modulesnextdistserverne xt-server.js:753:15)
at new Server (F:nextjshello-nextnode_modulesnextdistservernext-serve r.js:80:25)
at module.exports (F:nextjshello-nextnode_modulesnextdistservernext.j s:6:10)
at _callee$ (F:nextjshello-nextnode_modulesnextdistserverlibstart-se rver.js:33:37)
at tryCatch (F:nextjshello-nextnode_modulesregenerator-runtimeruntime.j s:62:40)
at Generator.invoke [as _invoke] (F:nextjshello-nextnode_modulesregenera tor-runtimeruntime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (F:nextjshello-next node_modulesregenerator-runtimeruntime.js:114:21)
at asyncGeneratorStep (F:nextjshello-nextnode_modules@babelruntime-core js2helpersasyncToGenerator.js:5:24)
at _next (F:nextjshello-nextnode_modules@babelruntime-corejs2helpersa syncToGenerator.js:27:9)
at F:nextjshello-nextnode_modules@babelruntime-corejs2helpersasyncToG enerator.js:34:7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 start: `next start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T08_25_2 3_194Z-debug.log
node.js reactjs next.js
add a comment |
up vote
0
down vote
favorite
I do everything according to the instructions https://nextjs.org/learn/basics/getting-started/setup
I run npm run dev
And displays an error
Div-Man@DivMan MINGW64 /f/nextjs/hello-next
$ npm run dev
> hello-next@1.0.0 dev F:nextjshello-next
> next
> Couldn't find a `pages` directory. Please create one under the project root
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 dev: `next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T07_58_57_773Z-debug.log
$ node -v
v10.6.0
$ npm -v
6.1.0
windows 8.1
package.json
{
"name": "hello-next",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"dev": "next",
"build": "next build",
"start": "next start"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"next": "^7.0.2",
"react": "^16.6.1",
"react-dom": "^16.6.1"
}
}
npm start
> hello-next@1.0.0 start F:nextjshello-next
> next start
Error: Could not find a valid build in the 'F:nextjshello-next.next' director y! Try building your app with 'next build' before starting the server.
at Server.readBuildId (F:nextjshello-nextnode_modulesnextdistserverne xt-server.js:753:15)
at new Server (F:nextjshello-nextnode_modulesnextdistservernext-serve r.js:80:25)
at module.exports (F:nextjshello-nextnode_modulesnextdistservernext.j s:6:10)
at _callee$ (F:nextjshello-nextnode_modulesnextdistserverlibstart-se rver.js:33:37)
at tryCatch (F:nextjshello-nextnode_modulesregenerator-runtimeruntime.j s:62:40)
at Generator.invoke [as _invoke] (F:nextjshello-nextnode_modulesregenera tor-runtimeruntime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (F:nextjshello-next node_modulesregenerator-runtimeruntime.js:114:21)
at asyncGeneratorStep (F:nextjshello-nextnode_modules@babelruntime-core js2helpersasyncToGenerator.js:5:24)
at _next (F:nextjshello-nextnode_modules@babelruntime-corejs2helpersa syncToGenerator.js:27:9)
at F:nextjshello-nextnode_modules@babelruntime-corejs2helpersasyncToG enerator.js:34:7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 start: `next start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T08_25_2 3_194Z-debug.log
node.js reactjs next.js
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I do everything according to the instructions https://nextjs.org/learn/basics/getting-started/setup
I run npm run dev
And displays an error
Div-Man@DivMan MINGW64 /f/nextjs/hello-next
$ npm run dev
> hello-next@1.0.0 dev F:nextjshello-next
> next
> Couldn't find a `pages` directory. Please create one under the project root
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 dev: `next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T07_58_57_773Z-debug.log
$ node -v
v10.6.0
$ npm -v
6.1.0
windows 8.1
package.json
{
"name": "hello-next",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"dev": "next",
"build": "next build",
"start": "next start"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"next": "^7.0.2",
"react": "^16.6.1",
"react-dom": "^16.6.1"
}
}
npm start
> hello-next@1.0.0 start F:nextjshello-next
> next start
Error: Could not find a valid build in the 'F:nextjshello-next.next' director y! Try building your app with 'next build' before starting the server.
at Server.readBuildId (F:nextjshello-nextnode_modulesnextdistserverne xt-server.js:753:15)
at new Server (F:nextjshello-nextnode_modulesnextdistservernext-serve r.js:80:25)
at module.exports (F:nextjshello-nextnode_modulesnextdistservernext.j s:6:10)
at _callee$ (F:nextjshello-nextnode_modulesnextdistserverlibstart-se rver.js:33:37)
at tryCatch (F:nextjshello-nextnode_modulesregenerator-runtimeruntime.j s:62:40)
at Generator.invoke [as _invoke] (F:nextjshello-nextnode_modulesregenera tor-runtimeruntime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (F:nextjshello-next node_modulesregenerator-runtimeruntime.js:114:21)
at asyncGeneratorStep (F:nextjshello-nextnode_modules@babelruntime-core js2helpersasyncToGenerator.js:5:24)
at _next (F:nextjshello-nextnode_modules@babelruntime-corejs2helpersa syncToGenerator.js:27:9)
at F:nextjshello-nextnode_modules@babelruntime-corejs2helpersasyncToG enerator.js:34:7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 start: `next start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T08_25_2 3_194Z-debug.log
node.js reactjs next.js
I do everything according to the instructions https://nextjs.org/learn/basics/getting-started/setup
I run npm run dev
And displays an error
Div-Man@DivMan MINGW64 /f/nextjs/hello-next
$ npm run dev
> hello-next@1.0.0 dev F:nextjshello-next
> next
> Couldn't find a `pages` directory. Please create one under the project root
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 dev: `next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T07_58_57_773Z-debug.log
$ node -v
v10.6.0
$ npm -v
6.1.0
windows 8.1
package.json
{
"name": "hello-next",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"dev": "next",
"build": "next build",
"start": "next start"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"next": "^7.0.2",
"react": "^16.6.1",
"react-dom": "^16.6.1"
}
}
npm start
> hello-next@1.0.0 start F:nextjshello-next
> next start
Error: Could not find a valid build in the 'F:nextjshello-next.next' director y! Try building your app with 'next build' before starting the server.
at Server.readBuildId (F:nextjshello-nextnode_modulesnextdistserverne xt-server.js:753:15)
at new Server (F:nextjshello-nextnode_modulesnextdistservernext-serve r.js:80:25)
at module.exports (F:nextjshello-nextnode_modulesnextdistservernext.j s:6:10)
at _callee$ (F:nextjshello-nextnode_modulesnextdistserverlibstart-se rver.js:33:37)
at tryCatch (F:nextjshello-nextnode_modulesregenerator-runtimeruntime.j s:62:40)
at Generator.invoke [as _invoke] (F:nextjshello-nextnode_modulesregenera tor-runtimeruntime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (F:nextjshello-next node_modulesregenerator-runtimeruntime.js:114:21)
at asyncGeneratorStep (F:nextjshello-nextnode_modules@babelruntime-core js2helpersasyncToGenerator.js:5:24)
at _next (F:nextjshello-nextnode_modules@babelruntime-corejs2helpersa syncToGenerator.js:27:9)
at F:nextjshello-nextnode_modules@babelruntime-corejs2helpersasyncToG enerator.js:34:7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-next@1.0.0 start: `next start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-next@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersDiv-ManAppDataRoamingnpm-cache_logs2018-11-08T08_25_2 3_194Z-debug.log
node.js reactjs next.js
node.js reactjs next.js
edited Nov 8 at 8:26
asked Nov 8 at 8:13
DivMan
1116
1116
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
The nextJS need to "pages" directory.
Make the "pages" and then inside make the index.js. (ex.pages/index.js)
New contributor
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The nextJS need to "pages" directory.
Make the "pages" and then inside make the index.js. (ex.pages/index.js)
New contributor
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
add a comment |
up vote
1
down vote
The nextJS need to "pages" directory.
Make the "pages" and then inside make the index.js. (ex.pages/index.js)
New contributor
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
add a comment |
up vote
1
down vote
up vote
1
down vote
The nextJS need to "pages" directory.
Make the "pages" and then inside make the index.js. (ex.pages/index.js)
New contributor
The nextJS need to "pages" directory.
Make the "pages" and then inside make the index.js. (ex.pages/index.js)
New contributor
New contributor
answered Nov 8 at 9:03
Sean Kim
448
448
New contributor
New contributor
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
add a comment |
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Thanks, why it is not written in the instructions?
– DivMan
Nov 8 at 9:22
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
Awwww haha I didn't know that. but when I read the NextJS document, there already explain. but it's not easy catch a once. So, When I first time to study nextjs, I watch the lecture in youtube.
– Sean Kim
Nov 8 at 12:24
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203694%2fcouldnt-find-a-pages-directory-nextjs%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password