Drill Down by code in PowerBI-JavaScript source code github throwing error - angularjs

After download the source code from Github as suggested in this community forum, run the application with ng serve -o and also run the commands
npm install --save-dev #angular/cli#latest but it throws the error like-
Local workspace file ('angular.json') could not be found. Error: Local
workspace file ('angular.json') could not be found. at
WorkspaceLoader._getProjectWorkspaceFilePath
(RND\PowerBI-JavaScript-master\PowerBI-JavaScript-master\demo\node_modules\#angular\cli\models\workspace-loader.js:37:19)
So, can anyone help me how to run this application

It seems you're trying to use the library for Power BI Embedding and are mistaking it for an angular component library of some sort.
Angular CLI is a library that helps when writing Angular applications, which in this case would probably require you to run ng init to create the angular.json and only then running ng serve.
Again, not sure what you're trying to do with regards to the linked library (PowerBI-Javascript)

Related

Electron application installed in system does not open because "iohook" library used in the "main.ts" file

I am making an application using ElectronJS and I am facing an issue.
FYI: I am using electron-react-boilerplate for my application. And I use a npm library called iohook to catch all the system inputs like key pressed etc..
So, I create ".deb" file for my linux using:
npm run package --linux
After this, I install the generated file using
sudo apt install ./fileName
Now, when I try to open this installed application by clicking on it it does not open. But when I comment all the code in "main.ts" file which is related to "iohook" and then create a build and install the application in system it opens up perfectly.
So, the main issue is the "iohook" library is not running in the production environment but runs perfectly in the development. What should I do to make it run in production as well?
Electron version: 8.5.2
iohook version: ^0.9.3
I cannot use higher(or latest) version of Electron or else I get issues because of version incompatibility.
Edit: Here is the link to the project repo
https://gitlab.com/vgoyal23/electron-apps
Found the answer in the issue below. I had to add iohook not just to /package.json but also in the /release/app/package.json.
Refer this issue https://github.com/wilix-team/iohook/issues/414

How to link and package external library with node-gyp for electron

I created a native OCR module using N-API (node-addon-api) with bindings to tesseract OCR.
My intention is to get native OCR working under electron. I basically checked all the npm packages related to OCR and they all don't work with electron. And here is my own test project
based on electron, which uses my node-native-ocr module:
https://github.com/stoefln/electron-ocr
My problem:
I don't manage to package all the dependencies when bundling electron. Or there seems to be a problem with the way I do it, because I am currently getting this error when running the electron project in production:
dyld: Symbol not found: _fmemopen Referenced from: /Volumes/Shared
Folders/Downloads/Electron
OCR.app/Contents/Resources/app/node_modules/node-native-ocr/build/Release/dependencies/liblept.5.dylib
Expected in: /usr/lib/libSystem.B.dylib
The way I am currently trying to package: The .node file which is generated depends on tesseract (built with brew) which depends on a lot of other libraries installed on the system.
What I came up with is a script which recursively reads dependencies (otool -l), copies them into the .node folder and changes the link (install_name_tool -change ...) to point to the copied dylib file.
I am not even sure if that's the right way of doing it. Shouldn't the node-gyp linker take care of linking AND packaging everything?
Here is somebody asking basically the same question: https://github.com/nodejs/node-gyp/issues/2258
More information if you want to reproduce my problem:
Run npm run export-mac
Copy the .app file to some other machine, to make sure it does not use the libararies in the system and only the ones which are packaged.
Start the app via the command line (otherwise you won't see the error): ./your_path_to_the_app_file/Electron\ OCR.app/Contents/MacOS/Electron\ OCR
Click the single button in the UI and check the terminal output

Error getting while building react kotlin app using IntelliJ

I've created a simple react app using create-react-kotlin-app. After successful npm start, I tried to get a build of the project using IntelliJ IDEA's Build -> Build Project, but it fails stating
Error:(16, 44) Kotlin: Can't access property 'reactLogo' marked with #JsModule annotation from non-modular project
What am I missing here ?
NOTE: I haven't done any modification in the template comes with create-react-kotlin-app. The project runs successfully, problem only exist when I try to get a build.
I got managed to fix this issue via terminal.
From the project root, run
react-scripts-kotlin build
This will automatically creates a build folder with production ready files.

How can I use Angular 2 with NetBeans?

I have tried every tutorial I could find to try to make a HTML/JS project with Angular 2 working on NetBeans, but none have worked. Maybe is my npm that is bugged (search, for example, doesn't work).
The node_modules folder that is created with npm install is grey on NetBeans and have some errors in some files (I don't know if this is normal). Any .js I try to import from node_modules folder gives the error Failed to load resource: net::ERR_EMPTY_RESPONSE / Uncaught ReferenceError: System is not defined.
Does anyone have any idea what could I be doing wrong? Or does anyone knows any tutorial that have the code to download so I can compare with what I'm doing and see what is the correct? Every tutorial I have found doesn't have any code to download, just some pieces of codes in the page for explanation.
Sory if this isn't a good question, but I have been trying to make this work since yesterday without success and I'm completely out of idea.
First I recommend to upgrade to the last version of NodeJS and NPM, to minimize the errors in your node_modules folder
Install the Everlaw's Typescript plugin from https://github.com/Everlaw/nbts/releases . If you are using Netbeans 8.1 I think you can install it directly from the Plugins installer. I'm using NetBeans 8.2 and there is no problems installing the plugin manually.
Then on NetBeans go to Tools -> Options -> HTML/JS -> Node.js and write the right Node and NPM Paths and Sources, I would recommend check-on the three check-boxes in that panel.
For a quick start try the QuickStart demo from the angular.io page, it is not necessary make any change in the package.json.
The first time I tried to debug an Angular 2 application I put the index.html file directly in the project folder in order to do not make any changes in the index.html script sources nor change the project files structure but you need to change some properties of the project:
In the project window right click the project and select properties.
In sources change the Site Root Folder using the Browse button and select the project folder (You can ignore the warning that appears).
In Run select Run As: Web Application.
I recommend select Browser: Chrome with NetBeans Connector
Using the Browse button go to the project folder and select index.html as your Start File.
Select Web Server: Embedded Lightweight.
And finally in Web Root write /Your_Project_Folder
run npm install from NetBeans
Click the run button and your web application must open in chrome, if you edit your html or typescript files and save them you could see the changes in the browser in real time without re-debuggind your application and can use the Browser DOM window to explore your elements created from Angular 2.
You still see some errors in your files because NetBeans is not fully compatible with the HTML Angularized syntax. But it runs flawlessly.
You can also run the start script directly from Netbeans to run your project using lite-Server.
Screenshot NetBeans - Angular 2
I would recommend you to install the angular cli: npm install -g angular-cli#webpack
Fore more infos regarding this tool, take a look here: https://cli.angular.io/
Then create a new Angular2 app with ng new <app-name>
This will create a complete and working Angular2 application in the current folder.
cd <app-name> and start the app with ng serve.
Check your new created app in your browser on localhost:4200.
If this works, you can try to get started with your NetBeans! :)

How to setup dev environment like egghead.io videos

I want to setup a environment on my machine to learn AngularJS. I saw in the videos of egghead.io where he keeps typing AngularJS code and when it refreshes through a server and displays the changes in realtime in the browser. How to do that? I see WebStrom logo in the videos but that's it.
You will need a server to setup your files. The videos you saw might have used browser-reload plugin which watches the files for changes and refreshes the page as soon as there's a change in any of the files.
You can use yeoman (and one of the generators) for project setup (for scaffolding basically). You will need to install NodeJS first which will install NPM (node package manager) with it. Then you can install YEOMAN and use the generator respectively. My recommendation would be generator-gulp-angular.
See the readme for the instructions, but basically you'll have to run these commands in command prompt after you've installed NodeJS properly.
npm install -g yo gulp bower
the above command installs yeoman,gulp and bower respectively
npm install -g generator-gulp-angular
the above command installs the gulp-angular yeoman generator
Then you can create a directory, say 'testDir' and navigate into it. I.e.
cd testDir
Then run
yo gulp-angular
You'll be asked to select desired technologies. Once you're done, you can run the following command to see it working (with live reload)
gulp serve
not sure what video you're talking about but it sounds like he/she has a gulp or grunt task that is watching for changes and then livereloading your browser. It could be either
gulp-livereload (https://www.npmjs.com/package/gulp-livereload)
or
browsersync (https://www.browsersync.io/)

Resources