You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng new command with --mobile flag fails while without --mobile flag works fine. #1174
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
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.
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
(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)
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)
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
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-universal0.103.3!
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.
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.
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
Activity
CarreraPHP commentedon Jun 23, 2016
After git pull. below is the error occurs during "npm start".
log:
p1 $npm start
(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 servenpm 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
bobrosoft commentedon Jun 23, 2016
+1 to that issue
scastaldi commentedon 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
(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 commentedon Jun 26, 2016
I'm seeing this too with beta.8. Mobile seems to be completely broken.
Splaktar commentedon Jun 26, 2016
This appears to be caused by using the old angular-universal
0.100.5which was needed due to dependency issues. Those issues have been fixed in angular-universal0.103.2.Though using this new version of angular-universal leads to the following exception:
PatrickJS commentedon Jun 26, 2016
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 commentedon Jun 26, 2016
@Splaktar can you update to
0.103.3Splaktar commentedon Jun 26, 2016
@gdi2290 OK, it's working now! Thanks.
Here's the output:
Verified that I'm also able to
ng serveit and that it loads properly.Looks like the fix for this issue is to upgrade
angular-clitoangular-universal0.103.3!PatrickJS commentedon Jun 26, 2016
kool, angular2-broccoli-prerender just needs to be updated now
SwagMuffinMcYoloPants commentedon 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
I used the following procedure.
I get an error saying
Also if I change angular2-universal@0.103.3 to latest, the same error occurs.
PatrickJS commentedon Jun 27, 2016
you also need to include parse5 ^1.5.0 and @angular/platform-server
SwagMuffinMcYoloPants commentedon Jun 27, 2016
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 commentedon Jul 1, 2016
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
mackelito commentedon Jul 5, 2016
Is This same issue as #958
Splaktar commentedon Jul 6, 2016
It's related but not the same.
BenevidesLecontes commentedon Jul 9, 2016
Beta.9 and this issue still here.
tagazok commentedon Jul 9, 2016
I confirm. I also still have the "Cannot read property 'makeCurrent' of undefined" on beta.9 :(
markjritchie commentedon Jul 13, 2016
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 commentedon Jul 28, 2016
Closed as issue was made obsolete by #1455.
angular-automatic-lock-bot commentedon Sep 6, 2019
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.