angular-cli: Error when running ng commands

After installing the angular-cli, when I run ng serve, ng help, and ng version I get the ‘AssetUrl’ error listed at the bottom)

OS?

Windows 8

Versions.

Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here:

node v6.1.0 npm v3.8.6

error on ng version:

Cannot read property ‘AssetUrl’ of undefined TypeError: Cannot read property ‘AssetUrl’ of undefined at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@angular\compiler-cli\src\private_import_compiler.js at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@angular\compiler-cli\src\reflector_host.js:13:33) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@angular\compiler-cli\src\path_mapped_reflector_host at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@angular\compiler-cli\src\codegen.js:16:36) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@angular\compiler-cli\index.js:12:17) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@ngtools\webpack\src\plugin.js:6:18) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules@ngtools\webpack\src\index.js:6:10) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules\angular-cli\models\webpack-build-typescript.js:5:17) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules\angular-cli\models\webpack-config.js:2:34) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules\angular-cli\tasks\build-webpack.js:6:24) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module._load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Object.<anonymous> (c:\Users\SCoon\Documents\libdev\front ode_modules\angular-cli\commands\build.js:3:23) at Module._compile (module.js:541:32) at Object.Module._extensions…js (module.js:550:10) at Module.load (module.js:456:32) at tryModuleLoad (module.js:415:12) at Function.Module.load (module.js:407:3) at Module.require (module.js:466:17) at require (internal/module.js:20:19) at Class.module.exports.includedCommands (c:\Users\SCoon\Doc ont-end\libations\node_modules\angular-cli\addon\index.js:21:16) at c:\Users\SCoon\Documents\libdev\front-end\libations\node cli\lib\models\project.js:392:61 at Array.forEach (native) at Project.addonCommands (c:\Users\SCoon\Documents\libdev\fr s\node_modules\angular-cli\lib\models\project.js:391:15) at Project.eachAddonCommand (c:\Users\SCoon\Documents\libdev ions\node_modules\angular-cli\lib\models\project.js:426:30) at module.exports (c:\Users\SCoon\Documents\libdev\front-end modules\angular-cli\lib\cli\lookup-command.js:33:13) at CLI.<anonymous> (c:\Users\SCoon\Documents\libdev\front-en _modules\angular-cli\lib\cli\cli.js:34:26) at tryCatch (c:\Users\SCoon\Documents\libdev\front-end\libat s\rsvp\dist\rsvp.js:538:12) at invokeCallback (c:\Users\SCoon\Documents\libdev\front-end modules\rsvp\dist\rsvp.js:553:13) at publish (c:\Users\SCoon\Documents\libdev\front-end\libati \rsvp\dist\rsvp.js:521:7) at flush (c:\Users\SCoon\Documents\libdev\front-end\libation svp\dist\rsvp.js:2373:5) at _combinedTickCallback (internal/process/next_tick.js:67:7 at process._tickCallback (internal/process/next_tick.js:98:9

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 6
  • Comments: 16 (4 by maintainers)

Most upvoted comments

I was able to work around this in angular-cli@1.0.0-beta.19-3 by doing a global replace in node_modules/@angular/compiler-cli/src/private_import_compiler.js

before:  __compiler_private__.
after:

in other words remove every occurrence of the before string.

No warranty expressed or implied. This is probably a bad thing to do, but I was able to get material2-app-master running with the above.

Just to confirm, on macOS Sierra with Node 6.4 I’m having the same problem, and the hack from @chrishandorf has me moving again.

I’ve got rid of the problem after updating to 1.0.0-beta.18 (at least on Windows OS machine)