You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I used 'const axios = require('axios');' in my javascript file.
When I build my Android application, the following error appeared.
/data/data/com.yourorg.sample/files/nodejs-project/node_modules/axios/index.js:1
(function (exports, require, module, __filename, __dirname) { import axios from './lib/axios.js';
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:588:28)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (/data/data/com.yourorg.sample/files/nodejs-project/demo.mjs:1:77)
But I had updated my node version and installed the axios by npm.
I really need to use axios library.
Does anyone know the reason? How can i fix it?
The text was updated successfully, but these errors were encountered:
As I used 'const axios = require('axios');' in my javascript file.
When I build my Android application, the following error appeared.
/data/data/com.yourorg.sample/files/nodejs-project/node_modules/axios/index.js:1
(function (exports, require, module, __filename, __dirname) { import axios from './lib/axios.js';
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:588:28)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (/data/data/com.yourorg.sample/files/nodejs-project/demo.mjs:1:77)
But I had updated my node version and installed the axios by npm.
I really need to use axios library.
Does anyone know the reason? How can i fix it?
The text was updated successfully, but these errors were encountered: