How can I resolve 'npm ERR! code ELIFECYCLE' in Project.js during npm start










3















I was following the getting started with create react native app to create my first react native application. But I am getting the following error -



npm start



2:11:42 PM: Starting packager... 

2:11:46 PM: Error starting packager:
Error: Couldn't start project. Please fix the errors and restart the
project.

at /xdl/src/Project.js:1039:11
at Generator.next (<anonymous>)
at step (/Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:191)
at /Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR! Failed at the my-app@0.1.0 start script.



The line of code this trace is referring to in the file Project.js -



function _asyncToGenerator(fn) return function () var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) function step(key, arg) try var info = gen[key](arg); var value = info.value; catch (error) reject(error); return; if (info.done) resolve(value); else return Promise.resolve(value).then(function (value) step("next", value); , function (err) step("throw", err); ); return step("next"); ); ; 


As suggested here npm ERR! code ELIFECYCLE I've tried to do a npm run clean and delete node_modules and npm install. But that didn't help either.



Version details -



➜ npm -v
5.0.1

➜ node -v
v8.0.0









share|improve this question
























  • specify your node and npm version.

    – jit
    Jun 5 '17 at 9:06











  • npm5 is not stable. can you try this with lower npm version.

    – jit
    Jun 5 '17 at 9:18











  • @jit any help on how do I test it specifically for this project, without uninstalling the existing version?

    – Naman
    Jun 5 '17 at 9:20











  • try "npm install -g npm@4.6.1" and to revert "npm install -g npm"

    – jit
    Jun 5 '17 at 9:36
















3















I was following the getting started with create react native app to create my first react native application. But I am getting the following error -



npm start



2:11:42 PM: Starting packager... 

2:11:46 PM: Error starting packager:
Error: Couldn't start project. Please fix the errors and restart the
project.

at /xdl/src/Project.js:1039:11
at Generator.next (<anonymous>)
at step (/Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:191)
at /Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR! Failed at the my-app@0.1.0 start script.



The line of code this trace is referring to in the file Project.js -



function _asyncToGenerator(fn) return function () var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) function step(key, arg) try var info = gen[key](arg); var value = info.value; catch (error) reject(error); return; if (info.done) resolve(value); else return Promise.resolve(value).then(function (value) step("next", value); , function (err) step("throw", err); ); return step("next"); ); ; 


As suggested here npm ERR! code ELIFECYCLE I've tried to do a npm run clean and delete node_modules and npm install. But that didn't help either.



Version details -



➜ npm -v
5.0.1

➜ node -v
v8.0.0









share|improve this question
























  • specify your node and npm version.

    – jit
    Jun 5 '17 at 9:06











  • npm5 is not stable. can you try this with lower npm version.

    – jit
    Jun 5 '17 at 9:18











  • @jit any help on how do I test it specifically for this project, without uninstalling the existing version?

    – Naman
    Jun 5 '17 at 9:20











  • try "npm install -g npm@4.6.1" and to revert "npm install -g npm"

    – jit
    Jun 5 '17 at 9:36














3












3








3


1






I was following the getting started with create react native app to create my first react native application. But I am getting the following error -



npm start



2:11:42 PM: Starting packager... 

2:11:46 PM: Error starting packager:
Error: Couldn't start project. Please fix the errors and restart the
project.

at /xdl/src/Project.js:1039:11
at Generator.next (<anonymous>)
at step (/Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:191)
at /Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR! Failed at the my-app@0.1.0 start script.



The line of code this trace is referring to in the file Project.js -



function _asyncToGenerator(fn) return function () var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) function step(key, arg) try var info = gen[key](arg); var value = info.value; catch (error) reject(error); return; if (info.done) resolve(value); else return Promise.resolve(value).then(function (value) step("next", value); , function (err) step("throw", err); ); return step("next"); ); ; 


As suggested here npm ERR! code ELIFECYCLE I've tried to do a npm run clean and delete node_modules and npm install. But that didn't help either.



Version details -



➜ npm -v
5.0.1

➜ node -v
v8.0.0









share|improve this question
















I was following the getting started with create react native app to create my first react native application. But I am getting the following error -



npm start



2:11:42 PM: Starting packager... 

2:11:46 PM: Error starting packager:
Error: Couldn't start project. Please fix the errors and restart the
project.

at /xdl/src/Project.js:1039:11
at Generator.next (<anonymous>)
at step (/Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:191)
at /Users/xyz/my-app/node_modules/xdl/build/Project.js:1461:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR! Failed at the my-app@0.1.0 start script.



The line of code this trace is referring to in the file Project.js -



function _asyncToGenerator(fn) return function () var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) function step(key, arg) try var info = gen[key](arg); var value = info.value; catch (error) reject(error); return; if (info.done) resolve(value); else return Promise.resolve(value).then(function (value) step("next", value); , function (err) step("throw", err); ); return step("next"); ); ; 


As suggested here npm ERR! code ELIFECYCLE I've tried to do a npm run clean and delete node_modules and npm install. But that didn't help either.



Version details -



➜ npm -v
5.0.1

➜ node -v
v8.0.0






node.js react-native npm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 5 '17 at 9:14







Naman

















asked Jun 5 '17 at 8:57









NamanNaman

44.5k11102204




44.5k11102204












  • specify your node and npm version.

    – jit
    Jun 5 '17 at 9:06











  • npm5 is not stable. can you try this with lower npm version.

    – jit
    Jun 5 '17 at 9:18











  • @jit any help on how do I test it specifically for this project, without uninstalling the existing version?

    – Naman
    Jun 5 '17 at 9:20











  • try "npm install -g npm@4.6.1" and to revert "npm install -g npm"

    – jit
    Jun 5 '17 at 9:36


















  • specify your node and npm version.

    – jit
    Jun 5 '17 at 9:06











  • npm5 is not stable. can you try this with lower npm version.

    – jit
    Jun 5 '17 at 9:18











  • @jit any help on how do I test it specifically for this project, without uninstalling the existing version?

    – Naman
    Jun 5 '17 at 9:20











  • try "npm install -g npm@4.6.1" and to revert "npm install -g npm"

    – jit
    Jun 5 '17 at 9:36

















specify your node and npm version.

– jit
Jun 5 '17 at 9:06





specify your node and npm version.

– jit
Jun 5 '17 at 9:06













npm5 is not stable. can you try this with lower npm version.

– jit
Jun 5 '17 at 9:18





npm5 is not stable. can you try this with lower npm version.

– jit
Jun 5 '17 at 9:18













@jit any help on how do I test it specifically for this project, without uninstalling the existing version?

– Naman
Jun 5 '17 at 9:20





@jit any help on how do I test it specifically for this project, without uninstalling the existing version?

– Naman
Jun 5 '17 at 9:20













try "npm install -g npm@4.6.1" and to revert "npm install -g npm"

– jit
Jun 5 '17 at 9:36






try "npm install -g npm@4.6.1" and to revert "npm install -g npm"

– jit
Jun 5 '17 at 9:36













4 Answers
4






active

oldest

votes


















2














The React code should be fine.



Did you maybe move your project to another folder?
Similar problem on github



Try the following:



  • Remove your node_modules folder in your project root rm -rf node_modules

  • Go to your project root and run npm install





share|improve this answer























  • Thanks. I've already mentioned trying the same in the question. But this didn't help.

    – Naman
    Jun 5 '17 at 9:19











  • Did you also get this error if you checkout a new react project from scratch?

    – Tobias Ernst
    Jun 5 '17 at 9:46











  • I've checked out a new project only. Using the getting started link.

    – Naman
    Jun 5 '17 at 9:47


















1














I tried all the above steps but the thing that work for me is to delete the "node_module" folder in home directory "C:Usersmusabarifnode_modules"



Make sure you have not installed something accidentally in your Home folder.






share|improve this answer






























    1














    I wouldn't claim to entirely understand the solution. I think it had something to do with either incorrect addresses recorded to navigate node_modules, or it may have been my version of watchman was outdated or corrupted.



    I fixed the issue by reinstalling watchman and deleting/recreating the node_modules and package-lock.json files.



    npm cache clean --force

    rm -rf node_modules

    rm -rf package-lock.json

    brew uninstall watchman

    npm r -g watchman

    npm install watchman

    yarn

    npm install

    react-native link

    npm start


    Some of the steps might be expendable but it took me a long time so I wanted it to be watertight.



    Good luck.






    share|improve this answer

























    • *** brew install watchman ***

      – Adam Durey
      Nov 18 '18 at 8:35


















    0














    Date - 12 June, 2017



    Just an FYI one liner -



    Seems like npm5 is not stable yet. As mentioned by @jit in the comments. The problem was resolved after reverting to npm 4.6.1



    npm install -g npm@4.6.1





    share|improve this answer























    • Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

      – Naman
      Jun 12 '17 at 4:44












    • is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

      – stackdave
      Aug 20 '17 at 17:31










    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',
    autoActivateHeartbeat: false,
    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%2f44365238%2fhow-can-i-resolve-npm-err-code-elifecycle-in-project-js-during-npm-start%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    The React code should be fine.



    Did you maybe move your project to another folder?
    Similar problem on github



    Try the following:



    • Remove your node_modules folder in your project root rm -rf node_modules

    • Go to your project root and run npm install





    share|improve this answer























    • Thanks. I've already mentioned trying the same in the question. But this didn't help.

      – Naman
      Jun 5 '17 at 9:19











    • Did you also get this error if you checkout a new react project from scratch?

      – Tobias Ernst
      Jun 5 '17 at 9:46











    • I've checked out a new project only. Using the getting started link.

      – Naman
      Jun 5 '17 at 9:47















    2














    The React code should be fine.



    Did you maybe move your project to another folder?
    Similar problem on github



    Try the following:



    • Remove your node_modules folder in your project root rm -rf node_modules

    • Go to your project root and run npm install





    share|improve this answer























    • Thanks. I've already mentioned trying the same in the question. But this didn't help.

      – Naman
      Jun 5 '17 at 9:19











    • Did you also get this error if you checkout a new react project from scratch?

      – Tobias Ernst
      Jun 5 '17 at 9:46











    • I've checked out a new project only. Using the getting started link.

      – Naman
      Jun 5 '17 at 9:47













    2












    2








    2







    The React code should be fine.



    Did you maybe move your project to another folder?
    Similar problem on github



    Try the following:



    • Remove your node_modules folder in your project root rm -rf node_modules

    • Go to your project root and run npm install





    share|improve this answer













    The React code should be fine.



    Did you maybe move your project to another folder?
    Similar problem on github



    Try the following:



    • Remove your node_modules folder in your project root rm -rf node_modules

    • Go to your project root and run npm install






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 5 '17 at 9:17









    Tobias ErnstTobias Ernst

    823811




    823811












    • Thanks. I've already mentioned trying the same in the question. But this didn't help.

      – Naman
      Jun 5 '17 at 9:19











    • Did you also get this error if you checkout a new react project from scratch?

      – Tobias Ernst
      Jun 5 '17 at 9:46











    • I've checked out a new project only. Using the getting started link.

      – Naman
      Jun 5 '17 at 9:47

















    • Thanks. I've already mentioned trying the same in the question. But this didn't help.

      – Naman
      Jun 5 '17 at 9:19











    • Did you also get this error if you checkout a new react project from scratch?

      – Tobias Ernst
      Jun 5 '17 at 9:46











    • I've checked out a new project only. Using the getting started link.

      – Naman
      Jun 5 '17 at 9:47
















    Thanks. I've already mentioned trying the same in the question. But this didn't help.

    – Naman
    Jun 5 '17 at 9:19





    Thanks. I've already mentioned trying the same in the question. But this didn't help.

    – Naman
    Jun 5 '17 at 9:19













    Did you also get this error if you checkout a new react project from scratch?

    – Tobias Ernst
    Jun 5 '17 at 9:46





    Did you also get this error if you checkout a new react project from scratch?

    – Tobias Ernst
    Jun 5 '17 at 9:46













    I've checked out a new project only. Using the getting started link.

    – Naman
    Jun 5 '17 at 9:47





    I've checked out a new project only. Using the getting started link.

    – Naman
    Jun 5 '17 at 9:47













    1














    I tried all the above steps but the thing that work for me is to delete the "node_module" folder in home directory "C:Usersmusabarifnode_modules"



    Make sure you have not installed something accidentally in your Home folder.






    share|improve this answer



























      1














      I tried all the above steps but the thing that work for me is to delete the "node_module" folder in home directory "C:Usersmusabarifnode_modules"



      Make sure you have not installed something accidentally in your Home folder.






      share|improve this answer

























        1












        1








        1







        I tried all the above steps but the thing that work for me is to delete the "node_module" folder in home directory "C:Usersmusabarifnode_modules"



        Make sure you have not installed something accidentally in your Home folder.






        share|improve this answer













        I tried all the above steps but the thing that work for me is to delete the "node_module" folder in home directory "C:Usersmusabarifnode_modules"



        Make sure you have not installed something accidentally in your Home folder.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 '18 at 6:05









        MusabMusab

        50477




        50477





















            1














            I wouldn't claim to entirely understand the solution. I think it had something to do with either incorrect addresses recorded to navigate node_modules, or it may have been my version of watchman was outdated or corrupted.



            I fixed the issue by reinstalling watchman and deleting/recreating the node_modules and package-lock.json files.



            npm cache clean --force

            rm -rf node_modules

            rm -rf package-lock.json

            brew uninstall watchman

            npm r -g watchman

            npm install watchman

            yarn

            npm install

            react-native link

            npm start


            Some of the steps might be expendable but it took me a long time so I wanted it to be watertight.



            Good luck.






            share|improve this answer

























            • *** brew install watchman ***

              – Adam Durey
              Nov 18 '18 at 8:35















            1














            I wouldn't claim to entirely understand the solution. I think it had something to do with either incorrect addresses recorded to navigate node_modules, or it may have been my version of watchman was outdated or corrupted.



            I fixed the issue by reinstalling watchman and deleting/recreating the node_modules and package-lock.json files.



            npm cache clean --force

            rm -rf node_modules

            rm -rf package-lock.json

            brew uninstall watchman

            npm r -g watchman

            npm install watchman

            yarn

            npm install

            react-native link

            npm start


            Some of the steps might be expendable but it took me a long time so I wanted it to be watertight.



            Good luck.






            share|improve this answer

























            • *** brew install watchman ***

              – Adam Durey
              Nov 18 '18 at 8:35













            1












            1








            1







            I wouldn't claim to entirely understand the solution. I think it had something to do with either incorrect addresses recorded to navigate node_modules, or it may have been my version of watchman was outdated or corrupted.



            I fixed the issue by reinstalling watchman and deleting/recreating the node_modules and package-lock.json files.



            npm cache clean --force

            rm -rf node_modules

            rm -rf package-lock.json

            brew uninstall watchman

            npm r -g watchman

            npm install watchman

            yarn

            npm install

            react-native link

            npm start


            Some of the steps might be expendable but it took me a long time so I wanted it to be watertight.



            Good luck.






            share|improve this answer















            I wouldn't claim to entirely understand the solution. I think it had something to do with either incorrect addresses recorded to navigate node_modules, or it may have been my version of watchman was outdated or corrupted.



            I fixed the issue by reinstalling watchman and deleting/recreating the node_modules and package-lock.json files.



            npm cache clean --force

            rm -rf node_modules

            rm -rf package-lock.json

            brew uninstall watchman

            npm r -g watchman

            npm install watchman

            yarn

            npm install

            react-native link

            npm start


            Some of the steps might be expendable but it took me a long time so I wanted it to be watertight.



            Good luck.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 15 '18 at 12:47

























            answered Nov 15 '18 at 12:18









            Adam DureyAdam Durey

            212




            212












            • *** brew install watchman ***

              – Adam Durey
              Nov 18 '18 at 8:35

















            • *** brew install watchman ***

              – Adam Durey
              Nov 18 '18 at 8:35
















            *** brew install watchman ***

            – Adam Durey
            Nov 18 '18 at 8:35





            *** brew install watchman ***

            – Adam Durey
            Nov 18 '18 at 8:35











            0














            Date - 12 June, 2017



            Just an FYI one liner -



            Seems like npm5 is not stable yet. As mentioned by @jit in the comments. The problem was resolved after reverting to npm 4.6.1



            npm install -g npm@4.6.1





            share|improve this answer























            • Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

              – Naman
              Jun 12 '17 at 4:44












            • is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

              – stackdave
              Aug 20 '17 at 17:31















            0














            Date - 12 June, 2017



            Just an FYI one liner -



            Seems like npm5 is not stable yet. As mentioned by @jit in the comments. The problem was resolved after reverting to npm 4.6.1



            npm install -g npm@4.6.1





            share|improve this answer























            • Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

              – Naman
              Jun 12 '17 at 4:44












            • is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

              – stackdave
              Aug 20 '17 at 17:31













            0












            0








            0







            Date - 12 June, 2017



            Just an FYI one liner -



            Seems like npm5 is not stable yet. As mentioned by @jit in the comments. The problem was resolved after reverting to npm 4.6.1



            npm install -g npm@4.6.1





            share|improve this answer













            Date - 12 June, 2017



            Just an FYI one liner -



            Seems like npm5 is not stable yet. As mentioned by @jit in the comments. The problem was resolved after reverting to npm 4.6.1



            npm install -g npm@4.6.1






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 12 '17 at 4:43









            NamanNaman

            44.5k11102204




            44.5k11102204












            • Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

              – Naman
              Jun 12 '17 at 4:44












            • is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

              – stackdave
              Aug 20 '17 at 17:31

















            • Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

              – Naman
              Jun 12 '17 at 4:44












            • is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

              – stackdave
              Aug 20 '17 at 17:31
















            Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

            – Naman
            Jun 12 '17 at 4:44






            Note - As a resolution for this is proposed with version npm5. Would mark that as an answer. By that time, hope this helps people trying things out.

            – Naman
            Jun 12 '17 at 4:44














            is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

            – stackdave
            Aug 20 '17 at 17:31





            is possible to use npm 4.6.1 with any version of node? by example node 4, 5 , 6 or 7. I dont believe that you can change your npm version is that is not related to node version...

            – stackdave
            Aug 20 '17 at 17:31

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44365238%2fhow-can-i-resolve-npm-err-code-elifecycle-in-project-js-during-npm-start%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

            Museum of Modern and Contemporary Art of Trento and Rovereto