Create a Custom Android Plugin: java.lang.NullPointerException (no error message) - ionic-framework
I´m developing this Android application to run on device.
I´m using Ionic and Angular to develop the application.
Now I need to create a custom plugin using Plugman. This plugin should allowed user to authentication using IBM APP ID.
I followed the instructions mention here https://github.com/ibm-cloud-security/appid-clientsdk-android
to create my gradle file.
However, when I run ionic cordova run android --verbose --debug
I get this error
What went wrong:
Execution failed for task :app:processDebugManifest.
java.lang.NullPointerException (no error message)
And I have no clue what could be the root cause. This is my first time I develop a custom plugin.
My suspicious relies on the dependency, but I can not tell what part is causing the issue.
Ionic Framework : #ionic/angular 5.0.7
#angular-devkit/build-angular : 0.803.26
#angular-devkit/schematics : 8.3.26
#angular/cli : 8.3.26
#ionic/angular-toolkit : 2.2.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)
Utility:
cordova-res (update available: 0.14.0) : 0.10.0
native-run (update available: 1.0.0) : 0.3.0
System:
Android SDK Tools : 26.1.1 (C:\\Android\\sdk)
NodeJS : v14.2.0 (C:\Program Files\\nodejs\\node.exe)
npm : 6.14.4
OS : Windows 10```
LOG=======================================
C:\project_cren\plugin\ci-uix-mobile-master>ionic cordova run android --verbose --debug
ionic:lib Terminal info: { ci: false, shell: 'C:\\WINDOWS\\system32\\cmd.exe', tty: false, windows: true } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: false, color: true, confirm: null, json: null, debug: true, project: null, '--': [] } +4ms
ionic:lib:project Project type from config: #ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\ionic.config.json', errors: [], context: 'app', type: 'angular' } +1ms
ionic Context: { binPath: 'C:\\Users\\AMANDODOSSANTOSNETO\\AppData\\Roaming\\npm\\node_modules\\#ionic\\cli\\bin\\ionic', libPath: 'C:\\Users\\AMANDODOSSANTOSNETO\\AppData\\Roaming\\npm\\node_modules\\#ionic\\cli', execPath: 'C:\\project_cren\\plugin\\ci-uix-mobile-master', version: '6.7.0' } +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\config.xml', package.json: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\package.json') +0ms
ionic:commands:run Native platform devices: [] +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\config.xml', package.json: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\package.json') +11s
ionic:lib:build build options: {
ionic:lib:build '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'android',
ionic:lib:build project: 'app',
ionic:lib:build verbose: false,
ionic:lib:build configuration: undefined,
ionic:lib:build sourcemaps: undefined,
ionic:lib:build cordovaAssets: true,
ionic:lib:build watch: undefined,
ionic:lib:build type: 'angular'
ionic:lib:build } +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +154ms
ng:analytics getGlobalAnalytics +0ms
ng:analytics Client Analytics config found: false +47ms
ng:analytics Analytics disabled. Ignoring all analytics. +1ms
ng:analytics getSharedAnalytics +0ms
WARNING in ./src/app/invoice-detail/invoice-detail.component.scss
Module Warning (from ./node_modules/postcss-loader/src/index.js):
Warning
(4:3) start value has mixed support, consider using flex-start instead
# ./src/app/invoice-detail/invoice-detail.component.ts 27:41-83
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ionic:lib:hooks Looking for ionic:build:after npm script. +40s
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
C:\project_cren\plugin\ci-uix-mobile-master\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --debug --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +1ms
ionic:utils-process error while killing process tree for 17344: Error: Command failed: taskkill /pid 17344 /T /F
ionic:utils-process ERROR: The process "17344" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 17344 /T /F'
ionic:utils-process } +472ms
ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 17344 /T /F
ionic:utils-process ERROR: The process "17344" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 17344 /T /F'
ionic:utils-process } +21ms
ionic:utils-process error while killing process tree for 2628: Error: Command failed: taskkill /pid 2628 /T /F
ionic:utils-process ERROR: The process "2628" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 2628 /T /F'
ionic:utils-process } +40ms
ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 2628 /T /F
ionic:utils-process ERROR: The process "2628" not found.
ionic:utils-process
ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12)
ionic:utils-process at ChildProcess.emit (events.js:315:20)
ionic:utils-process at maybeClose (internal/child_process.js:1051:16)
ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
ionic:utils-process killed: false,
ionic:utils-process code: 128,
ionic:utils-process signal: null,
ionic:utils-process cmd: 'taskkill /pid 2628 /T /F'
ionic:utils-process } +8ms
ionic:utils-process processExit: exiting (exit code: 1) +4ms
GRADLE FILE=====================================================================
android {
//compileSdkVersion 29
//buildToolsVersion "29.0.3"
defaultConfig {
manifestPlaceholders = ['appIdRedirectScheme': android.defaultConfig.applicationId]
}
}
dependencies {
implementation 'com.github.ibm-cloud-security:appid-clientsdk-android:6.+'
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
JAVA FILE ==============================================
package ibm.com.ibmappidcordovaplugin;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.ibm.cloud.appid.android.api.AppID;
import com.ibm.cloud.appid.android.api.AuthorizationException;
import com.ibm.cloud.appid.android.api.AuthorizationListener;
import com.ibm.cloud.appid.android.api.LoginWidget;
import com.ibm.cloud.appid.android.api.tokens.AccessToken;
import com.ibm.cloud.appid.android.api.tokens.IdentityToken;
import com.ibm.cloud.appid.android.api.tokens.RefreshToken;
/**
* This class echoes a string called from JavaScript.
*/
public class ibmappidcordovaplugin extends CordovaPlugin {
//PluginResult result = null;
private CallbackContext callbackContext = null;
private static final String SHOW_AUTH = "authentication";
LoginWidget loginWidget;
loginWidget = AppID.getInstance().getLoginWidget();
public ibmappidcordovaplugin(){
AppID.getInstance().initialize(getApplicationContext(), "cdb1c3ab-e8cf-49cf-9dff-9dfa4bf2a898", AppID.REGION_US_SOUTH);
}
#Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
this.callbackContext = callbackContext;
String msg = args.getJSONObject(0).getString("msg");
if (action.equals("authentication")) {
//String message = args.getString(0);
this.coolMethod(msg, callbackContext);
return true;
}
return false;
}
private void coolMethod(String message, CallbackContext callbackContext) {
if (message != null && message.length() > 0) {
auth();
callbackContext.success(create());
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
private void auth(){
loginWidget.launch(this, new AuthorizationListener() {
#Override
public void onAuthorizationSuccess(final AccessToken accessToken, final IdentityToken identityToken,
RefreshToken refreshToken) {
cordova.getActivity().runOnUiThread(new Runnable() {
#Override
public void run() {
console.log("Name: " + identityToken.getName());
console.log("user: " + accessToken.getScope());
console.log("getIdentities " + identityToken.getIdentities());
console.log("getRaw " + identityToken.getRaw());
for (String name : identityToken.getAudience() ) {
console.log("AUD: " +name);
}
for (String name : identityToken.getAuthenticationMethods() ) {
console.log("AUTH: " +name);
}
try {
JSONObject ob = identityToken.getPayload();
console.log("getPayload " + ob.getString("preferred_username"));
}
catch (Exception e){
console.log("Error: " + e.getMessage());
}
}
});
}
#Override
public void onAuthorizationCanceled() {
}
#Override
public void onAuthorizationFailure (AuthorizationException exception) {
}
});
}
private String create(/*IdentityToken identityToken*/){
String response = "";
try {
JSONObject token = new JSONObject();
String t = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFwcElkLWNkYjFjM2FiLWU4Y2YtNDljZi05ZGZmLTlkZmE0YmYyYTg5OC0yMDIwLTA5LTI1VDE1OjE5OjI4LjIxNyIsInZlciI6NH0.eyJpc3MiOiJodHRwczovL3VzLXNvdXRoLmFwcGlkLmNsb3VkLmlibS5jb20vb2F1dGgvdjQvY2RiMWMzYWItZThjZi00OWNmLTlkZmYtOWRmYTRiZjJhODk4IiwiYXVkIjpbIjc5NWUzMmVlZWFjMzIzMTM5YmM5ZWU3YmQ2NWEyMTc5YjNhNzc3ZjgiXSwiZXhwIjoxNjAyOTc2ODg0LCJ0ZW5hbnQiOiJjZGIxYzNhYi1lOGNmLTQ5Y2YtOWRmZi05ZGZhNGJmMmE4OTgiLCJpYXQiOjE2MDI5NzMyODQsImVtYWlsIjoiYW1hbmRvc0Bici5pYm0uY29tIiwibmFtZSI6IlZvbHVudGFyaW8gRmVsaXogZGEgVmlkYSIsInN1YiI6ImMyMjQ3ZWU3LTc3ZDEtNDFhMy04NjQ3LWRmNTNhMWMyMWJiMiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiIxMjM0NTY3OCIsImdpdmVuX25hbWUiOiJWb2x1bnRhcmlvIiwiZmFtaWx5X25hbWUiOiJGZWxpeiBkYSBWaWRhIiwiaWRlbnRpdGllcyI6W3sicHJvdmlkZXIiOiJjbG91ZF9kaXJlY3RvcnkiLCJpZCI6IjU0NmU5NTk5LWJjMGItNDIxNi04YzljLTQ2N2RjZWQ5NjQ4NCJ9XSwiYW1yIjpbImNsb3VkX2RpcmVjdG9yeSJdfQ.C4_2mj3fx3IwfqH4_O8CR4NtSNpgR7WTbjOz9j1XvrAZS9uiTswMyCn9q8N8pIh6BuP2RTmBhAtnkjAYt0rkHOtEHutf9J79GkpN33-H5P-5k9pqopUuawyFZlfEuH3m76PVnH2XkDUZ1EOTRKrtuHIyYS74tGOYgF8r3hBwjSbFZPTchkNAQmqn5FTgJ6LzUa3xBWt3C1nkvMw3nKrorAUtrsCZXD9PGJKlqJhpZXH9renSRa4KDDwswHzhLGiIghgAmvVoNwOsUWrWbQF88EGDKAkyQRCnTRo2lqdANtYlIwsVitGc9zkje6wDOhjjfZ6g24sj9Id-kK7Sw813aQ";
token.put("name", "Fulando da Silva"/*identityToken.getName()*/);
token.put("email", "fulano#test.com"/*identityToken.getEmail()*/);
token.put("token", t/*identityToken.getRaw()*/);
response = token.toString();
} catch (JSONException e) {
throw new RuntimeException(e);
}
return response;
}
}
Related
Flutter app running on web failing with error : app:compileFlutterBuildDebug'
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/method_channel_firestore.dart:112:15: Error: Method not found: 'Error.throwWithStackTrace'. Error.throwWithStackTrace( ^^^^^^^^^^^^^^^^^^^ /E:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:14:11: Error: Method not found: 'Error.throwWithStackTrace'. Error.throwWithStackTrace(exception, stackTrace); ^^^^^^^^^^^^^^^^^^^ /E:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:17:9: Error: Method not found: 'Error.throwWithStackTrace'. Error.throwWithStackTrace( ^^^^^^^^^^^^^^^^^^^ /E:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null. Never convertPlatformException(Object exception, StackTrace stackTrace) { ^ FAILURE: Build failed with an exception. Where: Script 'E:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035 What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'. Process 'command 'E:\flutter\bin\flutter.bat'' finished with non-zero exit value 1 Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org BUILD FAILED in 36s Exception: Gradle task assembleDebug failed with exit code 1 getData() async { CollectionReference userRef = FirebaseFirestore.instance.collection("user"); QuerySnapshot querySnapshot = await userRef.get(); List<QueryDocumentSnapshot> listDocs = querySnapshot.docs; listDocs.forEach((element) { print(element); }); }
Flutter : The getter 'Pestawait' isn't defined for the class 'RetryOptions'
I try to implement an app. And I run it several times with no errors. But without any reason, and after a day I try to run my app, I got the below error, and I try to find a solution for id but I did not find anything. So can someone provide me how can I solve it? Launching lib\main.dart on sdk gphone x86 in debug mode... lib\main.dart ../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/retry-3.0.1/lib/retry.dart:131:16: Error: Expected ';' after this. return Pestawait fn(); ^^^^^^^^^ ../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/retry-3.0.1/lib/retry.dart:131:16: Error: The getter 'Pestawait' isn't defined for the class 'RetryOptions'. - 'RetryOptions' is from 'package:retry/retry.dart' ('../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/retry-3.0.1/lib/retry.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pestawait'. return Pestawait fn(); ^^^^^^^^^ ../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.4.0/lib/flutter_datetime_picker.dart:215:48: Error: No named parameter with the name 'shadowThemeOnly'. ThemeData inheritTheme = Theme.of(context, shadowThemeOnly: true); ^^^^^^^^^^^^^^^ ../../../flutter/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match. static ThemeData of(BuildContext context) { ^^ FAILURE: Build failed with an exception. * Where: Script 'D:\mohy\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 900 * What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'D:\mohy\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 9m 1s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
It seems your library is broken. You can delete that folder and install that package again. Or for a quick fix, you can change that part in the related file as in here. Future<T> retry<T>( FutureOr<T> Function() fn, { FutureOr<bool> Function(Exception)? retryIf, FutureOr<void> Function(Exception)? onRetry, }) async { var attempt = 0; // ignore: literal_only_boolean_expressions while (true) { attempt++; // first invocation is the first attempt try { return await fn(); // Here is broken! } on Exception catch (e) { if (attempt >= maxAttempts || (retryIf != null && !(await retryIf(e)))) { rethrow; } if (onRetry != null) { await onRetry(e); } } // Sleep for a delay await Future.delayed(delay(attempt)); } } }
Unable to start Strapi on MacOS PostgreSQL
System - Node.js version: v10.19.0 - NPM version: 6.13.4 - Strapi version: 3.0.0-Beta.2 - Database: PostgreSQL 10.11 - Operating system: MacOS Catalina Describe the bug I am trying to run local Strapi on my Mac. npm run build works well. However, it has some problems with 'start' and 'develop'. When I am trying to start it by pm2 start npm --name "CMS" -- start, it keeps restarting. I have checked the app OUT-logs and there is a couple of errors e.g. { error: syntax error at or near "url" at Connection.parseE (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:602:11) at Connection.parseMessage (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:399:19) at Socket.<anonymous> (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:121:22) at Socket.emit (events.js:198:13) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) name: 'error', length: 92, severity: 'ERROR', code: '42601', detail: undefined, hint: undefined, position: '50', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'scan.l', line: '1128', routine: 'scanner_yyerror' } [2020-04-06T21:30:50.439Z] warn The SQL database indexes haven't been generated successfully. Please enable the debug mode for more details. { error: syntax error at or near "name" at Connection.parseE (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:602:11) at Connection.parseMessage (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:399:19) at Socket.<anonymous> (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:121:22) at Socket.emit (events.js:198:13) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) name: 'error', length: 93, severity: 'ERROR', code: '42601', detail: undefined, hint: undefined, position: '49', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'scan.l', line: '1128', routine: 'scanner_yyerror' } [2020-04-06T21:30:50.439Z] warn The SQL database indexes haven't been generated successfully. Please enable the debug mode for more details. When I am running npm run start I am getting the following error. 23 ], __knexQueryUid: '4301a348-badc-484f-a418-4f0f5ab4a2a6', sql: 'update "core_store" set "key" = ?, "environment" = ?, "tag" = ?, "value" = ?, "type" = ? where "id" = ?', returning: undefined } { method: 'insert', options: {}, timeout: false, cancelOnTimeout: false, bindings: [ 'development', 'plugin_upload_provider', '', 'object', '{"provider":"local","name":"Local server","enabled":true,"sizeLimit":1000000}' ], __knexQueryUid: '797edf19-aaab-43ff-a2f3-7c25519fb700', sql: 'insert into "core_store" ("environment", "key", "tag", "type", "value") values (?, ?, ?, ?, ?) returning "id"', returning: 'id' } { method: 'select', options: {}, timeout: false, cancelOnTimeout: false, bindings: [ 'plugin_users-permissions_advanced', '', '', 1 ], __knexQueryUid: '51c83527-e289-4c2b-bb0c-48fe7fd34d86', sql: 'select "core_store".* from "core_store" where "core_store"."key" = ? and "core_store"."environment" = ? and "core_store"."tag" = ? limit ?' } [2020-04-06T22:20:17.365Z] error error: duplicate key value violates unique constraint "core_store_pkey" at Connection.parseE (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:602:11) at Connection.parseMessage (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:399:19) at Socket.<anonymous> (/usr/local/var/www/trip4share-cms/node_modules/pg/lib/connection.js:121:22) at Socket.emit (events.js:198:13) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! trip4share-cms#1.0.0 start: `strapi start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the trip4share-cms#1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/Lord-of-the-Mac/.npm/_logs/2020-04-06T22_20_17_400Z-debug.log The remote version on Linux works well. What should I check?
(babel plugin) Error: .sourceMap must be a boolean, "inline", "both", or undefined
When attempting to package a nuxt component, I get the above error. I am running nuxt 2.4.5, #babel/core 7.0.0 and rollup 1.4.0. Does anyone have any thoughts? Thanks in advance.. npm run script: "build:es": "rollup --config build/rollup.config.js --format es --file dist/cxl-nuxt-map.esm.js" Command : nr build:es cxl-nuxt-map#1.0.0 build:es /Users/userinfo/Projects/cxl-nuxt-map rollup --config build/rollup.config.js --format es --file dist/cxl-nuxt-map.esm.js index.js → dist/cxl-nuxt-map.esm.js... Stack Trace: [!] (babel plugin) Error: .sourceMap must be a boolean, "inline", "both", or undefined index.js Error: .sourceMap must be a boolean, "inline", "both", or undefined at assertSourceMaps (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/option-assertions.js:65:11) at Object.keys.forEach.key (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/options.js:107:5) at Array.forEach (<anonymous>) at validateNested (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/options.js:83:21) at validate (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/validation/options.js:74:10) at file (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/config-chain.js:174:34) at cachedFunction (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/caching.js:33:19) at buildRootChain (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/config-chain.js:120:36) at loadPrivatePartialConfig (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/partial.js:85:55) at Object.loadPartialConfig (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/#babel/core/lib/config/partial.js:110:18) at Object.babel.loadPartialConfig (/Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/rollup-plugin-babel/src/index.js:80:20) at /Users/dan.mahoney/Projects/cxl-nuxt-map/node_modules/rollup/dist/rollup.js:17051:25 at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:47:5) at Function.Module.runMain (internal/modules/cjs/loader.js:804:11) at internal/main/run_main_module.js:21:11 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! cxl-nuxt-map#1.0.0 build:es: `rollup --config build/rollup.config.js --format es --file dist/cxl-nuxt-map.esm.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the cxl-nuxt-map#1.0.0 build:es script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/dan.mahoney/.npm/_logs/2019-03-01T20_10_17_889Z-debug.log Rollup.config.js: /* rollup.config.js */ import vue from 'rollup-plugin-vue'; import babel from 'rollup-plugin-babel'; import commonjs from 'rollup-plugin-commonjs'; import postcss from 'rollup-plugin-postcss'; import replace from 'rollup-plugin-replace'; import { plugin as analyze } from 'rollup-plugin-analyzer'; export default { input: 'index.js', output: { name: 'CxlNuxtMap', exports: 'named', }, plugins: [ postcss({ extensions: ['.css'], runtimeHelpers: true, exclude: 'node_modules/**', }), vue(), babel({ exclude: 'node_modules/**', }), replace({ 'process.env.INCLUDE_DEPS': JSON.stringify('false'), }), replace({ 'process.env.NODE_ENV': JSON.stringify('production'), }), commonjs({ namedExports: {}, }), analyze({ stdout: true }), ], };
Found in the problem in my .babelrc file. The offending line was: "sourceMap": "true", should be: "sourceMaps": true,
protractor sets error without opening browser
i download a new ionic project and i am trying to test the header contains these elements "" my config file is exports.config = { framework: 'jasmine2', seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['../www/head.spec.js'], multiCapabilities: [ { browserName: 'chrome' }] } named this as e2e.js my test case file is describe('header Module', function(){ var header; beforeEach(function() { header = element(by.css('title')); }); it('should check title text',function(){ expect(header.getText()).toContain('Ionic Blank Starter'); }); }); and i named this as head.spec.js my issue is that i could see the browser opened and my protractor sends an error msg empresss-Mac-mini:myApp admin$ protractor test/e2e.js Using the selenium server at http://localhost:4444/wd/hub [launcher] Running 1 instances of WebDriver /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172 callback(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444 at ClientRequest. (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172:16) at emitOne (events.js:77:13) at ClientRequest.emit (events.js:169:7) at Socket.socketErrorListener (_http_client.js:259:9) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at emitErrorNT (net.js:1253:8) at doNTCallback2 (node.js:439:9) at process.tickCallback (node.js:353:17) From: Task: WebDriver.createSession() at Function.webdriver.WebDriver.acquireSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30) at [object Object].Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22) at [object Object].DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7) at [object Object].Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:182:37) at /usr/local/lib/node_modules/protractor/lib/runner.js:263:21 at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13) at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49 [launcher] Process exited with error code 1 could someone help to fix this issue when i try to webdriver-manager update err msg is displayed empresss-Mac-mini:~ admin$ webdriver-manager update fs.js:799 return binding.mkdir(pathModule._makeLong(path), ^ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/protractor/selenium' at Error (native) at Object.fs.mkdirSync (fs.js:799:18) at Object.<anonymous> (/usr/local/lib/node_modules/protractor/bin/webdriver-manager:126:6) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10) at startup (node.js:134:18) at node.js:961:3 empresss-Mac-mini:~ admin$