4

I have installed visual studio apache cordova plugin and started creating the in built hello world app. but when I build I get this error. I have seen other people have the same issue on MSDN forums but no answer. can anyone help?

Cannot find module './lib/plugin'

Jason
  • 143
  • 1
  • 17

1 Answers1

11

Clear your Cordova Cache from within VS under Tools\Options\Tools for Apache Cordova\Cordova Tools. After you have done that, re-open your project and attempt a clean build. If you are still getting the same issue, inspect the contents of the folder %AppData%\Roaming\npm\node_modules\vs-mda\lib and reply back for further investigation.

Ellen
  • 1,189
  • 7
  • 9
  • 2
    I have same problem; clearing cache has not fixed it. There is no 'lib' folder in 'vs-mda', only 'node_modules' and some files including 'app.js' etc. It's a new install of VS2013 Community Edition. Outside of VS I can happily create cordova packages from the CLI, with no errors. – quilkin Jan 03 '15 at 21:03
  • 1
    @quilkin - if clearing the Cordova cache by itself doesn't fix the problem, try clearing the cache again and then follow that with this - from an admin command prompt run npm –g install \vs-mda, where the packages folder is under %Program Files%\Microsoft Visual Studio 12.0\Common7\IDE\Extensions, look for the one that contains a packages folder and that’s the one you want. – Ellen Jan 06 '15 at 22:58
  • 1
    Thanks, Ellen, solved - but not quite straightforward! I got a whole load of errors doing that, the first of which tried to tell me that "File exists: C:\Users\chris\AppData\Roaming\npm\node_modules\vs-mda\node_modules \plugman\node_modules\npm\man\man3" - but that file didn't exist! Assuming I was being given an incorrect error message, I checked the properties of the vs-mda folder and found it to be read-only. Removing that attribute made everything work. – quilkin Jan 07 '15 at 21:51