Node error


#1

(node:39211) UnhandledPromiseRejectionWarning: CordovaError: No platforms added to this project. Please use cordova platform add <platform>.
at Object.preProcessOptions (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:312:15)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/requirements.js:36:38
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:810:14
at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:108:17)
at process._tickCallback (internal/process/next_tick.js:61:11)
at Function.Module.runMain (internal/modules/cjs/loader.js:746:11)
at startup (internal/bootstrap/node.js:238:19)
(node:39211) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:39211) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


#2

Hello,
try to add a platform like cordova platform add android
The error means that as you create your project you didn’t set any platforms aka which os you want build for.

See here https://cordova.apache.org/docs/en/latest/guide/cli/

Best regards, anna-liebt


#3

thanks, my code working now