On Windows 10 x64 I tried to generate tabs in a sidemenu project. My output is:
C:\Users\Username>ionic start --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
? What would you like to name your project: myapp
? What starter would you like to use: sidemenu
[DEBUG] globalDeps=
√ Creating directory .\myapp - done!
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
√ Downloading - done!
[INFO] Fetching starter template sidemenu (https://github.com/ionic-team/ionic2-starter-sidemenu/archive/master.tar.gz)
√ Downloading - done!
√ Updating package.json with app details - done!
√ Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
> npm install
√ Running command - done!
[DEBUG] localDeps=@ionic/cli-plugin-ionic-angular
> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
√ Running command - done!
> git init
√ Running command - done!
> git add -A
√ Running command - done!
> git commit -m "Initial commit" --no-gpg-sign
√ Running command - done!
♬ ♫ ♬ ♫ Your Ionic app is ready to go! ♬ ♫ ♬ ♫
Run your app in the browser (great for initial development):
ionic serve
Run on a device or simulator:
ionic cordova run ios
Test and share your app on a device with the Ionic View app:
http://view.ionic.io
? Link this app to your Ionic Dashboard to use tools like Ionic View? No
Go to your newly created project: cd .\myapp
C:\Users\Username>cd .\myapp
C:\Users\Username\myapp>ionic generate tabs
? What should the name be? mytabs
? How many tabs? 2
? Name of this tab: one
? Name of this tab: two
TypeError: Cannot read property 'replace' of undefined
C:\Users\Username\myapp>ionic generate tabs --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
? What should the name be? mytabs
? How many tabs? 2
? Name of this tab: one
? Name of this tab: two
[DEBUG] !!! ERROR ENCOUNTERED !!!
TypeError: Cannot read property 'replace' of undefined
[DEBUG] TypeError: Cannot read property 'replace' of undefined
at Object.tabsModuleManipulation
(C:\Users\Username\myapp\node_modules\@ionic\app-scripts\dist\generators\util.js:177:105)
at C:\Users\Username\myapp\node_modules\@ionic\app-scripts\dist\generators.js:36:16
at <anonymous>
My ionic info output is
C:\Users\Username\myapp>ionic info --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
global packages:
@ionic/cli-utils : 1.5.0
Ionic CLI : 3.5.0
local packages:
@ionic/app-scripts : 2.0.2
@ionic/cli-plugin-ionic-angular : 1.3.2
Ionic Framework : ionic-angular 3.5.3
System:
Node : v8.2.1
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 5.3.0
I also encountered this exact same issue, only when trying to generate the tabs. Strange this is, the tabs were generated either way. You can find the issue over here on the CLI github:
and when I try to generate tabs again, a new error (which seems like a step forward at least…):
C:\Users\Username\myapp>ionic generate tabs --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
? What should the name be? mytabs
? How many tabs? 1
? Name of this tab: one
[DEBUG] !!! ERROR ENCOUNTERED !!!
TypeError: Cannot read property 'constants' of undefined
[DEBUG] TypeError: Cannot read property 'constants' of undefined
at Object.processTabsRequest (C:\Users\Username\myapp\node_modules\@ionic\app-scripts\dist\generators.js:28:46)
at Object.<anonymous> (C:\Users\Username\myapp\node_modules\@ionic\cli-plugin-ionic-angular\dist\generate.js:58:34)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Username\myapp\node_modules\@ionic\cli-plugin-ionic-angular\dist\generate.js:4:58)
at <anonymous>
also I updated object-keys as the warning mentions, but I get the same warning if I rerun the app-scripts install.
Hi, sorry for the delay, I uninstalled ionic and cordova and checked that all npm dependencies were installed. I then reinstalled cordova and ionic and installed the latest version of @ionic/app-scripts.
I again got the following output:
C:\Users\Username\MyProject>npm install @ionic/app-scripts@latest --save-dev
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
npm WARN ajv-keywords@2.1.0 requires a peer of ajv@>=5.0.0 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ @ionic/app-scripts@2.1.0
added 114 packages and updated 1 package in 65.289s
My ionic info for a new ionic sidemenu project is:
C:\Users\Username\MyProject>ionic info
global packages:
@ionic/cli-utils : 1.5.0
Ionic CLI : 3.5.0
local packages:
@ionic/app-scripts : 2.1.0
@ionic/cli-plugin-ionic-angular : 1.3.2
Ionic Framework : ionic-angular 3.5.3
System:
Node : v8.2.1
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 5.3.0
I am concerned about the ajv and outdated object-key dependencies: have tried all sorts to update, but nothing works. Do you think this may be affecting the ionic generate tabs function?