Skip to content

ng new command with --mobile flag fails while without --mobile flag works fine. #1174

Closed

Description

@CarreraPHP

OS:
Mac OSX El Capitan

NG Version:
angular-cli: 1.0.0-beta.6, node: 6.2.2, os: darwin x64

Reproduction step:
ng new project_name --mobile (the issue happens here, to see proper log need to do npm install inside the project folder)
cd project_name
npm install

log:


playbook-new-mobile4@0.0.0 /Users/yogeshofit/Desktop/angular2/workspace/Playbook-new-mobile4
├── UNMET PEER DEPENDENCY @angular/core@2.0.0-rc.2
├─┬ angular-cli@1.0.0-beta.6
│ ├── typescript@1.8.10
│ └─┬ typings@0.8.1
│ ├── bluebird@3.4.0
│ ├── minimist@1.2.0
│ └── wordwrap@1.0.0
├─┬ UNMET PEER DEPENDENCY angular2-universal@0.100.5
│ └── UNMET PEER DEPENDENCY angular2-universal@^0.102.0
└─┬ protractor@3.3.0
└─┬ request@2.67.0
└─┬ http-signature@1.1.1
└─┬ sshpk@1.8.3
├── ecc-jsbn@0.1.1
├── jodid25519@1.0.2
├── jsbn@0.1.0
└── tweetnacl@0.13.3

npm WARN @angular/app-shell@0.0.0 requires a peer of @angular/core@2.0.0-rc.1 but none was installed.
npm WARN angular2-express-engine@0.14.2 requires a peer of angular2-universal@^0.102.0 but none was installed.
npm WARN angular2-hapi-engine@0.14.0 requires a peer of angular2-universal@^0.102.0 but none was installed.
npm WARN angular2-express-engine@0.14.2 requires a peer of angular2-universal@^0.102.0 but none was installed.
npm WARN angular2-hapi-engine@0.14.0 requires a peer of angular2-universal@^0.102.0 but none was installed.


Similar issue happened in Angular/QuickStart (angular/quickstart#135)

Regards,
Yogesh Surendran alias CarreraPHP

Activity

  1. CarreraPHP commented on Jun 23, 2016

    @CarreraPHP
    ContributorAuthor

    After git pull. below is the error occurs during "npm start".

    log:


    p1 $npm start

    p1@0.0.0 start /Users/yogeshofit/Desktop/angular2/workspace/p1
    ng serve

    (node:1755) 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.
    Cannot read property 'makeCurrent' of undefined
    TypeError: Cannot read property 'makeCurrent' of undefined
    at Object. (/Users/yogeshofit/Desktop/angular2/workspace/p1/node_modules/angular2-universal/dist/node/node.js:7:35)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object. (/Users/yogeshofit/Desktop/angular2/workspace/p1/node_modules/angular2-universal/dist/node/index.js:5:17)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)

    npm ERR! Darwin 15.0.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
    npm ERR! node v6.2.2
    npm ERR! npm v3.9.5
    npm ERR! code ELIFECYCLE
    npm ERR! p1@0.0.0 start: ng serve
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the p1@0.0.0 start script 'ng serve'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the p1 package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! ng serve
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR! npm bugs p1
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR! npm owner ls p1
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR! /Users/yogeshofit/Desktop/angular2/workspace/p1/npm-debug.log


  2. bobrosoft commented on Jun 23, 2016

    @bobrosoft

    +1 to that issue

  3. scastaldi commented on Jun 23, 2016

    @scastaldi

    similar error... running rc3 in windows... I ran it without --mobile and it worked

    angular-cli: 1.0.0-beta.8
    node: 6.2.2
    os: win32 x64

    ng serve

    (node:7156) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please u
    Cannot read property 'makeCurrent' of undefined
    TypeError: Cannot read property 'makeCurrent' of undefined
    at Object. (D:\Employee\employee-ui\node_modules\angu
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object. (D:\Employee\employee-ui\node_modules\angu
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)

  4. Splaktar commented on Jun 26, 2016

    @Splaktar
    Contributor

    I'm seeing this too with beta.8. Mobile seems to be completely broken.

  5. Splaktar commented on Jun 26, 2016

    @Splaktar
    Contributor

    This appears to be caused by using the old angular-universal 0.100.5 which was needed due to dependency issues. Those issues have been fixed in angular-universal 0.103.2.

    Though using this new version of angular-universal leads to the following exception:

    ng build
    ⠸ BuildingDEPRECATION WARNING: `document` is no longer supported and will be removed in next release. Please use `template`
    DEPRECATION WARNING: `Bootloader#serializeApplication` arguments has changed.Please use an `AppConfig` object {providers: Array<any>, directives: Array<any>, template: string}
    EXCEPTION: Error in :0:0
    ORIGINAL EXCEPTION: The selector "app-root" did not match any elements
    ORIGINAL STACKTRACE:
    Error: The selector "app-root" did not match any elements
        at new BaseException (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/platform-browser/src/facade/exceptions.js:20:23)
        at NodeDomRenderer.DomRenderer.selectRootElement (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/platform-browser/src/dom/dom_renderer.js:83:23)
        at DebugDomRenderer.selectRootElement (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/core/src/debug/debug_renderer.js:19:39)
        at DebugAppView.AppView.selectOrCreateHostElement (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/core/src/linker/view.js:109:41)
        at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:12:21)
        at DebugAppView.AppView.create (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/core/src/linker/view.js:87:21)
        at DebugAppView.create (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/core/src/linker/view.js:299:44)
        at ComponentFactory.create (/Users/splaktar/Git/tf/beta8App/node_modules/@angular/core/src/linker/component_factory.js:147:36)
    
  6. PatrickJS commented on Jun 26, 2016

    @PatrickJS
    Contributor

    oh I found the problem. the angular2-broccoli-prerender plugin is using the old api that used document rather than template. I can add support for document again and release a patch

  7. PatrickJS commented on Jun 26, 2016

    @PatrickJS
    Contributor

    @Splaktar can you update to 0.103.3

  8. Splaktar commented on Jun 26, 2016

    @Splaktar
    Contributor

    @gdi2290 OK, it's working now! Thanks.

    Here's the output:

    ng build
    ⠸ BuildingDEPRECATION WARNING: `document` is no longer supported and will be removed in next release. Please use `template`
    DEPRECATION WARNING: `Bootloader#serializeApplication` arguments has changed.Please use an `AppConfig` interface {providers: Array<any>, directives: Array<any>, template?: string}
    Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
    Built project successfully. Stored in "dist/".
    

    Verified that I'm also able to ng serve it and that it loads properly.

    Looks like the fix for this issue is to upgrade angular-cli to angular-universal 0.103.3!

  9. PatrickJS commented on Jun 26, 2016

    @PatrickJS
    Contributor

    kool, angular2-broccoli-prerender just needs to be updated now

  10. SwagMuffinMcYoloPants commented on Jun 27, 2016

    @SwagMuffinMcYoloPants

    Have you guys tried use the -prod flag? It doesn't seem to be working for me.
    I'm using El Capitan and ng --version returns

    angular-cli: 1.0.0-beta.8
    node: 6.2.0
    os: darwin x64

    I used the following procedure.

    ng new hello-mobile --mobile
    npm i -D exists-sync
    npm i -D object-assign
    npm i -D minimatch
    npm i -D walk-sync
    npm i -D through
    npm install angular2-universal@ 0.103.3 --save
    npm install @angular/router-deprecated --save
    ng serve -prod

    I get an error saying

    fs.js:95
    throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
    ^

    Error: ENOTEMPTY: directory not empty, rmdir '/Users/lcorcuera/Documents/workspace/hello-mobile/dist/vendor/@angular/platform-server/node_modules/parse5'
    at Error (native)

    Also if I change angular2-universal@0.103.3 to latest, the same error occurs.

  11. PatrickJS commented on Jun 27, 2016

    @PatrickJS
    Contributor

    you also need to include parse5 ^1.5.0 and @angular/platform-server

  12. SwagMuffinMcYoloPants commented on Jun 27, 2016

    @SwagMuffinMcYoloPants

    Thanks. I tried that and it didn't work still. I noticed that when I did try that, it kept bringing up different dependencies. Out of curiosity, I decided to delete the dist directory and everything worked. I must've tried to do "ng serve" before doing "ng serve -prod". I tried making a new project and it seems to not like when you switch from doing "ng serve" to "ng serve -prod" which is why it keeps saying that folders aren't empty. Weird issue but at least I can finally have the production bundle! Thanks for all the help.

  13. warnerpinz commented on Jul 1, 2016

    @warnerpinz

    What should be the version to use for devDependency "angular2-broccoli-prerender" ?
    I tried changing the version to 0.103.3, but I still get the same error. THanks

  14. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Jul 4, 2016
  15. mackelito commented on Jul 5, 2016

    @mackelito

    Is This same issue as #958

  16. Splaktar commented on Jul 6, 2016

    @Splaktar
    Contributor

    It's related but not the same.

  17. BenevidesLecontes commented on Jul 9, 2016

    @BenevidesLecontes

    Beta.9 and this issue still here.

  18. tagazok commented on Jul 9, 2016

    @tagazok

    I confirm. I also still have the "Cannot read property 'makeCurrent' of undefined" on beta.9 :(

  19. markjritchie commented on Jul 13, 2016

    @markjritchie

    I have the same problem too. I know that we're in Beta ere but it would be good if at least

    ng new foo
    ng new foo --mobile

    were tested before each release.

  20. filipesilva commented on Jul 28, 2016

    @filipesilva
    Contributor

    Closed as issue was made obsolete by #1455.

  21. angular-automatic-lock-bot commented on Sep 6, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenttype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions