Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CarreraPHP opened this issue Jun 22, 2016 · 20 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@CarreraPHP
Copy link
Contributor

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:


[email protected] /Users/yogeshofit/Desktop/angular2/workspace/Playbook-new-mobile4
├── UNMET PEER DEPENDENCY @angular/[email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ UNMET PEER DEPENDENCY [email protected]
│ └── UNMET PEER DEPENDENCY angular2-universal@^0.102.0
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
└─┬ [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN [email protected] requires a peer of angular2-universal@^0.102.0 but none was installed.
npm WARN [email protected] requires a peer of angular2-universal@^0.102.0 but none was installed.
npm WARN [email protected] requires a peer of angular2-universal@^0.102.0 but none was installed.
npm WARN [email protected] 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

@CarreraPHP
Copy link
Contributor Author

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

log:


p1 $npm start

[email protected] 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! [email protected] start: ng serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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


@bobrosoft
Copy link

+1 to that issue

@scastaldi
Copy link

scastaldi commented Jun 23, 2016

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)

@Splaktar
Copy link
Contributor

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

@Splaktar
Copy link
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)

@PatrickJS
Copy link
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

@PatrickJS
Copy link
Contributor

@Splaktar can you update to 0.103.3

@Splaktar
Copy link
Contributor

Splaktar commented Jun 26, 2016

@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!

@PatrickJS
Copy link
Contributor

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

@SwagMuffinMcYoloPants
Copy link

SwagMuffinMcYoloPants commented Jun 27, 2016

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 [email protected] to latest, the same error occurs.

@PatrickJS
Copy link
Contributor

PatrickJS commented Jun 27, 2016

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

@SwagMuffinMcYoloPants
Copy link

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.

@warnerpinz
Copy link

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

@filipesilva filipesilva added type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jul 4, 2016
@mackelito
Copy link

Is This same issue as #958

@Splaktar
Copy link
Contributor

Splaktar commented Jul 6, 2016

It's related but not the same.

@BenevidesLecontes
Copy link

Beta.9 and this issue still here.

@tagazok
Copy link

tagazok commented Jul 9, 2016

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

@markjritchie
Copy link

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.

@filipesilva
Copy link
Contributor

Closed as issue was made obsolete by #1455.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

No branches or pull requests