Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'at-least-node'

Unable to load Platform API from /Users/RK/Documents/IONIC/ionic/myApp/platforms/ios/cordova/Api.js: Cannot find module 'at-least-node'

making ios build in ionic 3.4

like image 591
anshuverma Avatar asked Aug 08 '20 05:08

anshuverma


People also ask

How to fix error Cannot find module?

If you are getting the "Cannot find module" error when trying to run a local file, make sure that the path you passed to the node command points to a file that exists. For example, if you run node src/index. js , make sure that the path src/index. js points to an existing file.

Can not find module TS?

The "Cannot find module or its corresponding type declarations" error occurs when TypeScript cannot locate a third-party or local module in our project. To solve the error, make sure to install the module and try setting moduleResolution to node in your tsconfig. json file.


1 Answers

Pretty sure the magic that fixed it for me:

  • delete /node_modules, /platforms, /plugins, /package-lock.json
  • re-run troubled command(s)

But here are all the things I did (incase it was a different thing that actually fixed it)....

Windows:

  • Upgrading node from 12.14.0 -> 15.x
  • delete node_modules, platforms, plugins, package-lock.json
  • re-run troubled command(s)
    • success!

Mac:

  • Upgrading node from 12.14.0 -> 14.15.0 (probably didn't actually matter)
  • delete node_modules, platforms, plugins
  • re-run troubled command(s)
    • failed
  • delete node_modules, platforms, plugins, package-lock.json
  • Restart computer (mac)
  • re-run troubled command(s)
    • success!

All are on Cordova 9.0.0 and node 14+.
Received this error when installing plugins usually.
Got the error for building ios and android.

like image 147
Lindsay-Needs-Sleep Avatar answered Oct 03 '22 02:10

Lindsay-Needs-Sleep