Ionic serve error angular tsc-wrapped

Hi All

I’ve been given an existing ionic project to work on which was built on a Mac computer.

I have windows 10 pro 64-bit machine.

I have done all the necessary installations in order to run the ionic project provided. Everything seems to be running fine until i run the command ‘ionic serve’ which returns a 'Error: Cannot find module ‘@angular/tsc-wrapped/src/tsc’.

Whenever I try to run the ‘npm install @angular/tsc-wrapped autoprefixer’ command in hope of fixing the above error, it generates the following errors:

npm WARN ionic-img-viewer@2.4.0 requires a peer of ionic-angular@~3.4.0 but none was installed.

npm ERR! Cannot read property '0' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Marko\AppData\Roaming\npm-cache\_logs\2017-08-14T17_58_14_232Z-debug.log

Any help is greatly appreciated, i’ve been struggling for the past 2 days to get this working!

Thanks in advance

Can you describe in as much detail as possible as if you were explaining to somebody really curious and stupid exactly what you received and how? I’m particularly interested in the node_modules directory and whether version control was involved.

1 Like

It was transferred to me via an external hard drive, the project folder was copied and pasted from the mac computer.
I’m not too sure about version control, the node_modules directory was transferred to me as well.
Please let me know of any other information you may need!
I’m still struggling to solve this issue.

Just as a side note, if i run a new ionic project, it runs perfectly fine and starts the local dev server with no issues.

Thanks!

In the future, please tell whoever gave you this to use git and transfer things that way.

That’s bad, and likely a major source of your problems. Completely clean it out and then run npm i in the project directory. Also clean out the platforms directory, remove any platforms that exist, and then readd whichever you want. If all else fails, create a new project and inject the relevant bits of the src directory from the doomed project into it.

Despite claims in the changelog, that img-viewer may not work well with Ionic 3.x. Still an open issue, and it isn’t a major image viewer. You might want to crawl npm for one that is better maintained.

1 Like

Is there a guide on how to correctly inject these files into the new project? I’m assuming it wont work if i just copy and paste the src folder from the one project to the other.

Doing that and copying package.json and config.xml should give you a very solid start.

I copied the files and it still runs, but shows me the ionic blank starter page.

delete the packake-lock.json
delete node_modules
update nodejs 6.x
update npm -g i npm