I`m making an Electron app that should connect by grpc to remote host and call some functions from there.
But I keep getting the following error:
Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\?\D:\Projects\demo-app\node_modules\grpc\src\node\extension_binary\grpc_node.node
I tried to:
establish grpc connection from main and from renderer processes of Electron
install dependencies as npm install --unsafe-perm
but nothing works.
Error
The gRPC package is distributed with precompiled binaries for Electron, including on Windows, but you have to specify that you're using Electron when you do the installation. The following should work:
npm install grpc --runtime=electron --target=<electron version>
If you're using a native module, you'll need to rebuild them against your current electron node version.
There is a package called electron-rebuild that will do this for you. Basic instructions:
npm install --save-dev electron-rebuild
Then, whenever you install a new npm package, rerun electron-rebuild:
./node_modules/.bin/electron-rebuild
Or if you're on Windows:
.\node_modules\.bin\electron-rebuild.cmd
Related
When I try to create a react native project version 0.59.9 I get the following error
error Error: Couldn't find the "/var/folders/zc/h93bvpb573q24_5ynvgkn1wc0000gn/T/rncli-init-template-0YT6FZ/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid.
How can I resolve this issue?
The command I used is npx react-native init Awesome --version 0.59.9
How can I resolve this issue, and what could be the cause of it?
Here's a screenshot of the terminal as well
Thanks
Be sure uninstall global react-native/cli as described react-native tutorials
Try to use --npm end of init command if you had yarn and npm both.
npx react-native init MyApp --template react-native-template-typescript --npm
Note: If you have both yarn and npm installed on your machine, React Native CLI will always try to use yarn, so even if you use npx utility, only react-native executable will be installed using npm and the rest of the work will be delegated to yarn. You can force usage of npm adding --npm flag to the command.
You can try to use a template from another version
npx react-native init Awesome --version 0.59.9 --template=react-native#0.60.0-rc.1
I have a NodeJS application which has only typescript files in it, no js files. I want to run in on my server in the background.
How can I archive that?
I tried using the npm package called forever but it only works with js files as it doesn't understand the typescript code.
You could use forever in combination with ts-node.
Here is a link to the npm package ts-node
I would suggest using the following command:
forever start -v -c ts-node app.ts
Where -v/--verbose is for turning on the verbose messages from Forever.
And -c is the COMMAND to execute which is default is node
This question is so old and forever now discourages to use it.
For new installations we encourage you to use pm2 or nodemon
Here is a quick tutorial on how to run your Typescript project as a background process.
Install PM2 globally:
npm install pm2 -g
Build your sources with Typescript default config:
tsc
You will have a new directory dist that contains your js files.
pm2 start dist/app.js
Bonus: you can monitor your app with the following command.
pm2 monit
first use
npm install -g ts-node
then use
forever start -v -c ts-node app.ts
it shuld start now
The two production quality recommendations I would make are:
Turn it into a docker container
Write a systemd service
Those are by far the best options. If for some reason this doesn't work:
pm2
supervisord
I'm trying to use pusher.subscribe() on the server side, but Pusher is only for client side.
I found this: https://github.com/pusher/pusher-http-node
Which allows us to set up a pusher for the server side. However, the readme is outdated and I can't set it up.
Running this command
npm install pusher --prefix cloud/modules
Only creates: cloud/modules/etc and cloud/modules/node_modules.
This means I cant run
$ cd cloud/modules/pusher
$ npm run parse-build
Please help!
try to use cd cloud/modules/node_modules/pusher and then npm run parse-build it will create build for Parse cloud
'Creating build for Parse Cloud.' && webpack --config=./parse.webpack.js Creating build for Parse Cloud. sh: webpack: command not found
Install webpack using npm install -g webpack globally or locally to install webpack local for the project npm install -D to install all dev dependencies in your cd cloud/modules/node_modules/pusher directory.It is recommended to install webpack locally so that you need not to stick to a particular version for different projects.
You can't subscribe with Pusher you can only trigger and some other functions
if you want to subscribe from the server side(nodejs e.t.c)
use pusher-js
npm i pusher-js or yarn add pusher-js
I am trying to create new app with create-react-app.
Below is the error.
Please help. Thanks in advance
➜ REACT create-react-app my-app
Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /media/budi/Tjung/#TJUNG/REACT/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.
error image at CLI
Looks like network problem to me. You could be behind a proxy. If that is the case, configure your proxy in npm like this
npm config set proxy http://proxy_host:port
For https
npm config set https-proxy http://proxy.company.com:8080
Note: The https-proxy doesn't have https as the protocol, but http.
Optionally you can also try,
npm config set strict-ssl false
Checkout this SO answer
check if npm exists on your system.
try the commands in this order.
1. npm install --save create-react-app
2. create-react-app projectname
The name of the project must be in lowercase
Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:
npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "my-app":
create-react-native-app my-app
cd my-app
npm start
I have solve this problem.. it is about internet speed connection.
.
When I met this problem, I have spent one day to find out the solution. I read so many article about ETIMEDOUT. I had uninstall and re-install npm and yarn. Still doesn't solve my problem.
.
Until then I found the spot that has high speed internet connection. Fortunately I can create new app with create-react-app.
I think there are problem with your configurations of npm package.
Maybe somewhere, you set up some proxy configuration to npm variables.
You can reset configs running this script in terminal
sudo sh -c 'echo "" > $(npm config get globalconfig)'
and wait until process will end and run
exit
Open another terminal window and try
I am trying to create Angular2 project using angular-cli. I run, npm install -g angular-cli then I ng new test, it returns
"'ng' is not recognized as an interal or external command, operable
program or batch file."
I check the directory, C:\node\node_modules\npm\node_modules. There was not angular-cli found. My npm version is 4.0.2 and my node version is 5.11.0. If you guys have same problem, could you help me how to figure this out?
From angular-cli docs
Prerequisites
Both the CLI and generated project have dependencies that require Node
6.9.0 or higher, together with NPM 3 or higher.
You need to upgrade your node and npm first.
1) As VadimB suggested, you need to upgrade node and npm versions. Install latest version of node from nodejs.org and make sure you choose minimum Node 6.9.0 setup.
2) You are trying to run wrong command.
Current version command is - npm install -g #angular/cli (Please note - # before angular/cli package in above command.)
3) After #angular/cli installation, you can use ng help or ng -v to check successful installation and version.
4) You are looking at wrong folder. Once installed successfully, #angular\cli will be available in C:\Users\<UserName>\AppData\Roaming\npm\node_modules\
Installing Angular Dependencies
Install a stable version of Node (if not already installed) and verify the installation using node -v
Install TypeScript using command npm install -g typescript
Download and install Angular CLI using command npm install -g #angular/cli
Angular is a component oriented framework. Many components needs to be created to make the whole application. A component is a group of custom elements, HTML elements, ShadowDOM & HTML imports.
Creating the Angular 4 app using Angular CLI
To create a fresh new Angular 4 app, use command ng new newAppName. This command takes some time to execute.
package.json - takes care of the development and app dependencies / packages / commands to execute
src\main.ts - takes care of the scaffolding the entire
src\app\app.module.ts - any newly created module has to added to the declarations and services has to be provided to the providers key parameter of the function #NgModule to make them accessible across the entire application
Run the Angular 4 app using Angular CLI
To run the freshly created app using CLI, use command ng serve which will run the app on http://localhost:4200/.
Use this code :
npm install -g #angular/cli