I am trying to build my app with the --prod flag.
ionic cordova build android --verbose --prod
However, when I do, I get the error:
Cannot find type definition file for '@types'.
[17:12:58] ionic-app-script task: "build"
[17:12:58] Error: Failed to transpile TypeScript
Error: Failed to transpile TypeScript
The app builds fine in release, but not prod.
Any ideas would be appreciated.
Are you missing
@types altogether on your project?
I have the same error now, but yesterday the build --prod was working
Same error here… we changed nothing and this error popped up on friday
ionic-app-script was recently updated producing this error.
As a workaround, you can lock its version in your package.json to the last working one:
Thank you! That solved my error!
Ah, great thanks. This has sorted the issue. Shame the package testing isn’t up to scratch…
Noting that it won’t work globally, so
npm i @firstname.lastname@example.org only should work =)
it worked for me.
the problems i spent days on, solved! thank you
just editing the package.json didn’t change anything.
npm i @email@example.com command and it solved.
thanks to @luciojb
Better still, you can use the latest app scripts still if you add this to your
This might depend on your project
@types but give it a go, worked for me.
Gracias esto resolvio mi problema, no olviden luego de actualizar el packge.json hacer
Think this is the way to go. It worked for me without locking to an older version of app-script
“types”: [ “node” ]
i get the following error:
Cannot find type definition file for 'node'.
It seems you don’t have the
@types/node type definitions in your project, I didn’t expressly install them on mine either, I assumed they were one of Ionic’s dependencies, maybe run
npm i and try run it again after that to make sure they’re installed.
Edit - I believe
@types/node is one of the
Thanks, works with npm i
Should work with latest, must be something different between your project and mine.
@sbrazell I don’t think downgrading is the option. Many thanks @sbrazell!
My project uses several types like:
I had the problem described in this topic with the version 3.2.4 of the app-scripts.
Fixed by adding to the types definition, but still reference them on devDependencies as above, and it worked. My types look like this:
ps: jQuery hmmmm eclectic project. but still works with this fix.