Error when build or run

No problem. Good luck.

Ok, back to the drawing board once more.

I tried to force myself back to 2.1.0 (which was pretty close to my app version) and I still had no luck. I am getting some sort of dependency issue on any sort of build.

Since that time I have uninstalled node, deleted node folders under c:\program files\ and c:\users<myname>\ to try and ensure no older versions were lying around.

I went back and tried… 2.0.0, 2.1.0, 2.2.0, and 2.2.1. I keep getting the same cryptic error:

Error: Unable to read property “length” of undefined.

At some point this morphed into

Error: Unable to read property “codeGen” of undefined.

The second error seemed very familiar to the post you linked me to yesterday - however it does not clearly state what is to be done to fix it (and I am having a hard time finding out if my Ionic version and my Angular version jive).

It appears I may need a little more guidance towards fixing this if you can help?

You’re probably not going to want to hear this, but it’s going to be really difficult to motivate anybody to bother assisting on a project that is dependent on obsolete and unsupported versions of things. If you want useful help, you are going to need to commit to fixing incompatibilities with the current supported versions of your dependencies.

1 Like

I just went back to 3.3.0 to give it another shot, thinking I may have better luck with a new version (which I am still unable to do a build – ionic serve only). In fact, I cannot build a new app with no external dependencies. So something is not jiving in my sandbox right now.

My suggestion re your problem would be to tear it all down - uninstall node completey, install nvm (or nvm-windows) and reinstall node through that, then cordova and ionic, then check out your project and clean it (delete /platforms, delete /plugins, delete node_modules), run npm install and add the platforms and plugins back.

Ok. So this must be a machine issue. I have the project running on two other Macs, but I cannot seem to get it running on my Windows 7 machine again. I even have it now to where it will build in Ionic 3.3.0 on two late 2011 Macbook Pros.

Steps tried yesterday with Windows 7:

  • Uninstalled Node.js

  • Deleted the following folders from my machine (to ensure node was gone):
    *c:\program files\node
    *c:\users<username>\appdata\roaming\npm
    *c:\users<username>\appdata\roaming\npm-cache
    *c:\users<username>.ionic
    *c:\users<username>.cordova

  • Installed NVM for Windows

  • Installed node.js 6.9.5 through NVM

  • Installed npm 5.0.0 through NVM

  • Cloned git repository to a new folder

  • npm install -g cordova ionic@latest

  • Double checked versions in packages.json

  • Tripled checked versions in packages.json

  • npm install

  • cordova platform add android

  • cordova platform build android

Am I missing an obvious step somewhere? I replicated this exact same procedure on two Macs and had no problem. Is there something else I am not cleaning off my Windows machine properly that is leaving me unable to get things matched up properly? The build continues to fail with one of the above referenced error messages (this time it happens to be “Cannot read property “length” of undefined”).

Any other thoughts on something to try?

Thanks

-LB

Are the working machines and the non-working machine in the same network environment?

Additionally, can you please post your app.module.ts?

1 Like