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









share|improve this question




























    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









    share|improve this question


























      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









      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 8 at 8:26

























      asked Nov 8 at 8:13









      DivMan

      1116




      1116
























          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)






          share|improve this answer








          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • 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













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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
































          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)






          share|improve this answer








          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • 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

















          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)






          share|improve this answer








          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • 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















          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)






          share|improve this answer








          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          The nextJS need to "pages" directory.



          Make the "pages" and then inside make the index.js. (ex.pages/index.js)







          share|improve this answer








          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered Nov 8 at 9:03









          Sean Kim

          448




          448




          New contributor




          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Sean Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • 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










          • 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




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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




















































































          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff