ConnectSDK / Connect-SDK-Cordova-Plugin

Cordova/PhoneGap plugin for Connect SDK
Apache License 2.0
69 stars 46 forks source link

Error: Cannot find module 'internal/fs' #62

Open KlaasVanDerLinden opened 7 years ago

KlaasVanDerLinden commented 7 years ago

cordova -v 7.0.1

npm -v 5.0.3

node -v v8.1.4

When running the following command: cordova plugin add cordova-plugin-connectsdk I get the following error:

Installing "cordova-plugin-connectsdk" for android Subproject Path: CordovaLib Subproject Path: cordova-plugin-connectsdk/radio_app-Connect-SDK-Android Failed to install 'cordova-plugin-connectsdk': Error: Cannot find module 'internal/fs' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at evalmachine.:40:20 at Object. (C:\cz-test\plugins\cordova-plugin-connectsdk\scripts\node_modules\unzip\node_modules\fstream\node_modules\graceful-fs\fs.js:11:1) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) Error: Cannot find module 'internal/fs'

This happens after having added the Android platform. Without the platform added, there is no error.

Bejor commented 7 years ago

I have got the same Problem. Is there anyway how I can fix this issue because I am not able to find a Plugin which supports as much Platforms as this Plugin!

cordova -v 7.0.1

npm -v 5.2.0

node -v v7.9.0

Bejor commented 7 years ago

I fixed this issue.

I used the node 6 version via the nvm command and added the android platform on version 5.2.2. And everything worked perfectly fine.

lmaiacosta commented 6 years ago

UP Someone have a solution to recent versions of cordova? Failed to install 'cordova-plugin-connectsdk': Error: Cannot find module 'internal/errors'

For now i use the @Bejor solution: /* Install NVM (Node Version Mananger) **/ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash /* Downgrade node version **/ nvm install v5.12.0

Apparently it works