Skip to content

You have to be inside an angular-cli project in order to use the build command. #1400

Closed

Description

@WG-Com
#i run this command 
git add *
git commit -m 'msg'
ng github-pages:deploy --message "Optional commit message"

then error to me :

#ng build
You have to be inside an angular-cli project in order to use the build command.

#ng g component hello
You have to be inside an angular-cli project in order to use the g command.

.....

Activity

  1. aciccarello commented on Jul 21, 2016

    @aciccarello
    Contributor

    Could you explain why this is unexpected? The cli needs to know how the project is configured.

  2. WG-Com commented on Jul 21, 2016

    @WG-Com
    Author

    which config file ?

    steps:

    ng new hello  -> ok
    ng g component user -> ok
    ng g component .... -> ok
    ng serve -> ok
    ng build -> ok
    
    git add *
    git commit -m 'msg'
    ng github-pages:deploy --message "Optional commit message"  -> error => github token no permission
    @here looks like delete my src/ dir and many other files , my src source code lost
    ng build -> error:
    You have to be inside an angular-cli project in order to use the build command.
    ........
    
    
  3. WG-Com commented on Jul 21, 2016

    @WG-Com
    Author

    happend again:

    ng github-pages:deploy --message "msg"
    (node:5689) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
    Could not start watchman; falling back to NodeWatcher for file system events.
    Visit http://ember-cli.com/user-guide/#watchman for more info.
    Built project successfully. Stored in "dist/".
    fs.js:95
          throw err;  // Forgot a callback but don't know where? Use NODE_DEBUG=fs
          ^
    
    Error: ENOTEMPTY: directory not empty, rmdir 'next/dist/vendor/@angular/platform-browser/src/'
    
    ng github-pages:deploy --message "msg"
    ng build
    You have to be inside an angular-cli project in order to use the build command.
    
  4. WG-Com commented on Jul 21, 2016

    @WG-Com
    Author

    now files in projects:(no src dir and config files now )

     >ls
    404.html         dist             index.html       node_modules     tmp              vendor
    app              favicon.ico      main.js          system-config.js typings
    
    > ls dist
    app              favicon.ico      index.html       main.js          system-config.js vendor
    
  5. filipesilva commented on Jul 21, 2016

    @filipesilva
    Contributor

    Hi @WG-Com, it seems like something went wrong in the deploy procedure, namely the error that you got: error => github token no permission.

    Sometimes when this happens the repo is left on the gh-pages branch and you need to manually git checkout master. Your code is still there and safe.

    I thought That I had picked fixed all scenarios where that happens but it seems there is at least one still. I'll try to fix it.

  6. self-assigned this
    on Jul 21, 2016
  7. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    on Jul 21, 2016
  8. kylecordes commented on Jul 21, 2016

    @kylecordes

    I realize this item is about a bug, but I'd like to suggest as alternative to "The cli needs to know how the project is configured": I think it would be quite possible and useful for a subset of the CLI functionality to work on "non-CLI" project. I was recently working on such a project, and wanted to scaffold a few components. CLI could have done 90% of it for me, if CLI was willing to run on non-CLI projects. It would need to skip a few bits here and there and assume some defaults, but still more useful than refusing to run. Obviously not a priority for today... but maybe eventually?

  9. filipesilva commented on Jul 21, 2016

    @filipesilva
    Contributor

    @kylecordes I'd prefer to not mix up the two things in this issue tbh, since the crux of the issue here is a bad error catcher that leaves the repo in the wrong branch and not the project restrictions. Happy to have another issue open for discussion though.

  10. kylecordes commented on Jul 27, 2016

    @kylecordes

    @filipesilva I made #1464 a feature request for the idea above.

  11. intellix commented on Aug 30, 2016

    @intellix
    Contributor

    Just a thought, how about serving directly from dist by using this: https://github.com/blog/2228-simpler-github-pages-publishing ?

  12. filipesilva commented on Sep 20, 2016

    @filipesilva
    Contributor

    @intellix I was thinking about that really... it would make the process a LOT simpler. Have you checked if it also works with user/organization pages? If so, I'm definitely partial to changing it that way.

    The whole thing could be rewritten with a ng build --output-path=docs --base-url=projectName this way.

  13. intellix commented on Dec 13, 2016

    @intellix
    Contributor

    afraid I've never used it before, but they just posted a new blog post about it becoming even easier if it's relevant :) https://github.com/blog/2289-publishing-with-github-pages-now-as-easy-as-1-2-3

  14. 6 remaining items

  15. abhinaypandey commented on Feb 8, 2017

    @abhinaypandey

    I am also getting the same issue. As @iBWhite said that it should be @angular/cli in package.json so I have the same entry though I am getting the same error.

  16. maplion commented on Feb 9, 2017

    @maplion

    I had "angular-cli": "1.0.0-beta.24" in my package.json and I updated it with a package.json overwrite, that changed it to "@angular/cli": "1.0.0-beta.30", which gave me this error. I changed it back to "angular-cli": "1.0.0-beta.24" and it is working again. I ended up here because of the unclear message as well.

  17. abhinaypandey commented on Feb 9, 2017

    @abhinaypandey
  18. abhinaypandey commented on Feb 9, 2017

    @abhinaypandey

    @maplion I tried that but it's asking me to select versions below 1.0.0-beta.28.3. It says could not find specified dependency.

  19. maplion commented on Feb 9, 2017

    @maplion

    @abhinaypandey I ran an npm install -g @angular/cli and an npm install @angular/cli and it seems to be bundling/compiling again as intended with the new format "@angular/cli": "1.0.0-beta.30".

    Note: I did have to rename / delete my node_modules folder and redo an npm install in order to clean up some other errors I was getting after the change.

  20. plastikaweb commented on Feb 9, 2017

    @plastikaweb

    I just run into this problem,
    Fixed updating angular-cli in this way:

    npm uninstall -g angular-cli @angular/cli
    npm cache clean
    npm install -g @angular/cli@latest

    No need to delete the node_modules folder

  21. dinhkk commented on Feb 10, 2017

    @dinhkk

    I have tried @plastikaweb 's instructions, but not successed

  22. plastikaweb commented on Feb 10, 2017

    @plastikaweb

    mmm @dinhkk have you tried to run ng init after that?

  23. JGdijk commented on Feb 16, 2017

    @JGdijk

    @plastikaweb solution worked for me after changing my package.json, angular-cli.json and running ng init after that.

  24. nbora98 commented on Mar 6, 2017

    @nbora98

    Hi ,
    Try the below solution may be it could help.
    Step 1. Run this command on root folder [npm install -g angular -cli]
    Step 2. Create new folder for your project [ng new project_folder_name]
    Step 3. Enter inside that folder [cd project_folder_name]
    Step 4. Run the project by this command [ng serve]
    (Note: Now on localhost:4200, the demo project will run)
    Step 5. Copy the '/src' folder of your existing project and replace with the '/src' of your newly created project from Project's root folder only.

    Do let me know if you have any confusion.

  25. seize11 commented on Mar 22, 2017

    @seize11

    @nbora98 hey ,Your last sentence blind my dog's eyes

  26. WG-Com commented on Mar 22, 2017

    @WG-Com
    Author

    @seize11 你亮瞎了我的狗眼

  27. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  28. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions