Ionic-cli: Cannot read property 'magenta' of undefined logger shalk

Created on 4 Nov 2017  路  5Comments  路  Source: ionic-team/ionic-cli

Description:

After updating to cli: 3.16.0
When trying to build/serve the project I get the following error:
TypeError: Cannot read property 'magenta' of undefined
at Object. (...node_modules/@ionic/cli-utils/lib/utils/logger.js:8:30)

Steps to Reproduce:
create a project, nom install, ionic serve

Example repo:

1.
2.
3.

Output:

My ionic info:
even ionic -v fails

Other Information:
This seems normal to me since the version of shalk I have has no default field

Most helpful comment

delete package-lock.json and update package.json (delete also the folde node_modules) then npm install

All 5 comments

issue disappears after reinstalling everthing

What do you mean with, after reinstalling the issues disappears? I have the problems to and nothing helps.

TypeError: Cannot read property 'magenta' of undefined
at Object. (/app/node_modules/@ionic/cli-utils/lib/utils/logger.js:8:30)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/app/node_modules/@ionic/cli-utils/index.js:19:18)
at Module._compile (module.js:571:32)

@wietzehiha

  • update ionic cli to version 3.x
  • create a new project: ionic start test
  • copy dependencies from test project to your project

I tried the 3 steps but got the same error. What do you mean by dependencies? package-lock.json and package.json?

delete package-lock.json and update package.json (delete also the folde node_modules) then npm install

Was this page helpful?
0 / 5 - 0 ratings