I've successfully built node.js addon, which works well with Node on Windows.
Now, I want to create a Windows app using Electron. When loading the module in HTML file, I got the error:
var dbr = require('./build/Release/dbr');
Something wrong with ATOM_SHELL_ASAR.js.
The issue only occurred on Windows. On Linux and Mac, it worked well.
How can I fix it?
Thanks!
You need to rebuild your native Node addon for Electron, the steps are outlined in the docs.
I'm using Electron 2 version and have the same error with another module.
I solved this problem by this advise on Electron page: To ensure your native dependencies are always matched electron version, simply add script "postinstall": "electron-builder install-app-deps" to your package.json.
And then I changed: "postinstall": "electron-builder install-app-deps && npm run lint:fix". Then npm run postinstall.
Related
I'm new to react and react-native, and am attempting to run the react-native-windows template project but have encountered an issue.
Error
App loads in a blank window with error banner Error 80072f78 downloading http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true
Image for reference
What I've Tried
I followed the instructions on the react-native-windows getting started docs
Namely:
npx react-native init <projectName> --template react-native#^0.63.2
cd projectName
npx react-native-windows-init --overwrite
npx react-native run-windows
The process will start another terminal window with the react logo. The application will build successfully, and will start in a new window. However, the original error is always present.
I've tried uninstalling and reinstalling all relevant programs. I've also tried building in both c# and c++, to no avail (adding the --language flag in the third step above).
Versions
react-native-windows: 0.63
react-native: 0.63.2
Windows SDK: 10.0.18362.0
node: 14.16.0
npm: 6.14.11
I couldn't find any issues like this online. If anyone has a suggestion, I would appreciate it. I'm more than happy to provide further info. Thanks!
Not using a pre-existing boilerplate like electron-vue, I'd like to set up a Electron app with Vue.js. What is the procedure to do so, specifically for a beginner?
So far,I have installed vue cli globally with NPM, created my project with vue create, then installed electron into it with npm install electron.
From here is where everything falls apart. The article I was following specifies starting the app with dev, which runs: "NODE_ENV=DEV vue-cli-service serve & sleep 5 && NODE_ENV=DEV electron app.js". For whatever reason, this doesn't work. Comments on the article seem to suggest these commands are linux formatted, but no one has provided a windows formatted equivalent.
electron . starts the app, as expected, but vue components just dont work. Adding a basic <script src="> tag to the vue CDN at the top of the index.html works, and causes it to work, but ideally I'd like the electron app to work offline, which I believe was the point of using vue-cli as opposed to just importing it from the CDN.
Is there a simple way to do this? or would I be better off just downloading vue manually, throwing it into a folder in the electron app, and loading it with a script tag?
The easiest way to create an Electron app with vue.js as the frontend framework:
install vue-cli 3:
npm install -g #vue/cli
create a project (be patient because it may take a while):
vue create myproject
cd myproject
add and invoke the generator of vue-cli-plugin-electron-builder (it will automatically set up electron for you and let you check changed files):
vue add electron-builder
test your app:
npm run electron:serve
or build your app:
npm run electron:build
See more in this guide: https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/#to-start-a-development-server
This works in Windows Powershell if all PATH variables to vue-cli-sevice and electron are correct:
set NODE_ENV=DEV ; vue serve ; timeout 5 ; electron app.js
Note that the new version of vue changed some commands:
https://cli.vuejs.org/guide/installation.html
Windows command help:
Setting and getting Windows environment variables from the command prompt?
How do I run two commands in one line in Windows CMD?
What solved the issue in the end was changing relative paths to absolute.
Also this was useful: https://nklayman.github.io/vue-cli-plugin-electron-builder/
I am new to react-native and have found an error that makes absolutely no sense to me.
I am trying to include a calendar library: https://github.com/wix/react-native-calendars
I have included the dependency for that library in my package.json file and run npm install
The project was running fine and as expected. I have simply added one line of code to the project:
import { Calendar, CalendarList, Agenda } from 'react-native-calendars';
Nothing else. However now I am getting a red error message when the app loads on device and this is what my console is saying:
error: bundling failed: Error: While trying to resolve module xdate
from file
/Users/Alex/Documents/workspace/mobile/node_modules/react-native-calendars/src/index.js,
the package
/Users/Alex/Documents/workspace/mobile/node_modules/xdate/package.json
was successfully found. However, this package itself specifies a
main module field that could not be resolved
(/Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js.
Indeed, none of these files exist:
*
/Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
*
/Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)
at ResolutionRequest.resolveDependency (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:103:15)
at DependencyGraph.resolveDependency (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/node-haste/DependencyGraph.js:272:4579)
at dependencies.map.relativePath (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:376:19)
at Array.map ()
at resolveDependencies (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:374:16)
at /Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:212:33
at Generator.next ()
at step (/Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:313)
at /Users/Alex/Documents/workspace/mobile/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:473
at
However I have checked in the directory and in fact /Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js does exist. However I do not see any of this part: (.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
As to how /Users/Alex/Documents/workspace/mobile/node_modules/xdate/src/xdate.js/index can exist, that doesn't make sense because xdate.js is not a directory.
Any help?
It Usually happens if you try to install a module while your packager is open.
Try to delete node_modules folder and close the packager.
Then reinstall everything by npm install in your project directory.
First close your JavaScript bundler (Metro bundler in my case) and restart the application. This will create fresh dependency graph. This should solve the issue.
Just restart the bundler - no need to delete the Node Modules folder
I came across this issue when adding and using react-native-elements when using VS Code and Android Studio emulator on Linux Mint
In VS Code I had a terminal running Expo with Metro Bundler via 'npm start' command. After installing the react-native-elements in the folder (using 'npm install --save react-native-elements') and adding the import into the .js file I got the "However, this package itself specifies a main module field that could not be resolved" error.
In my case, this just involved a ^C in the terminal session to stop the Metro bundler and then running 'npm start' again. There was no need to delete the node modules folder at all.
If you're still getting the error even after deleting the ./node_modules folder and running npm install again, try doing the install with the --update-binary flag, i.e npm install --update-binary. This should clear out and rebuild any previously built packages on your machine.
Please don't delete the node modules folder.
The bundler has least to deal with node modules folder.
Instead close all the terminals. If using VS-code close that also.
Close all the local host server ports and if possible restart the system.
This might solve the issue.
If anyone have same issue, and remove node_module not working. Then you can try remove all node_module, package lock and using yarn to install node_module instead npm. Hope this help
None of the solutions above helped me except for restarting my MacBook. Wasted 30 minutes trying to fix this issue as I couldn't believe restarting my computer could be a solution.
I am trying to run an Ionic 2 Application. I am getting following error on running ionic serve
build dev failed: Cannot set property 'fileSystem' of null
The complete log is as below:
λ ionic serve
> ionic-hello-world# ionic:serve D:\ionic
> ionic-app-scripts serve
[18:11:23] ionic-app-scripts 0.0.47
[18:11:24] watch started ...
[18:11:24] build dev started ...
[18:11:24] clean started ...
[18:11:24] clean finished in 6 ms
[18:11:24] copy started ...
[18:11:24] transpile started ...
[18:11:28] transpile finished in 4.15 s
[18:11:28] webpack started ...
[18:11:28] build dev failed: Cannot set property 'fileSystem' of null
[18:11:28] dev server running: http://localhost:8100/
[18:11:28] copy finished in 4.39 s
[18:11:28] watch ready in 4.44 s
Update your ionic app scripts to the latest version. It is 1.0.0 for RC5 release.
npm install #ionic/app-scripts#latest --save-dev.
As suggested, check the package.json from here.
Run npm install
This worked for me:
In your project go to yourProjectname\node_modules\#typesoject
Then install
$ npm install pouchdb #types/pouchdb
You can now use
import PouchDB from 'pouchdb';
as explained here here
I also faced this issue for Ionic2 application. When i tried to run the application in ripple browser it was telling "You're almost ready! If you're seeing this page, then you still need to install the NPM Task Runner extension for Visual Studio and run this app again. You can download the extension from:".
I struggled a lot to resolve the issue i was using visual studio 2015 Update3.
Finally i got a solution issue was with ionic "#ionic/app-scripts".
To resolve the issue i fallowed the below steps.
1] execute command "npm uninstall -g ionic" in Command Prompt.
2] Update the version of #ionic/app-scripts to 1.1.4 i.e "#ionic/app-scripts": "1.1.4" in package.json file and Save the file.
3] execute command "npm install -g ionic" in Command Prompt.
it will give some warning don't need to wary about it.
4] again i have done Restore Packages by right clicking on the packages.json file.
5] next go to view menu in the visual studio and select other windows from there select Task Runner Explorer.
6] Right Click on ionic:build select Binding > Before Build(it will make the all the ionic component to build first before deploying to www directory.
Make sure you have deleted the node_module folder before starting these steps.
That's all everything got set to me application started working fine.
I hope it will help some one.
Second solution is instead black project take sidemenu project even if you fail do the above mentioned steps and restart the visual studio and create new project with sidemenu it will work fine.
Created new app with
ember new app-name
version: 1.13.13
node: 5.5.0
npm: 2.14.10
os: linux x64
After running
"ember s"
App works proper in browser
As per guide at https://github.com/dgeb/ember-engines for running ember engine ran below command
ember install ember-engines
rm -rf bower_components
bower install --save ember#canary #Choosed ember#canary from prompt
bower install
And now when i do "ember s" app gets compile properly in CLI but app gets crash in browser and i see nothing in browser.
In console i see below error message
Uncaught Error: Could not find module ember-views/views/select
Tried debugging it, Could not find solution. Is i am missing somthig basic here ?
Note :: I am new to ember. I think this would be small one but could not find solution on web as well.
Sorry about that! There were a few commits/fixes on master that hadn't been released yet.
I just released v0.2.1 which should clear this up for you.