I am trying to install gatsby CLI by using below npm
npm install --global gatsby-cli
and stuck with the below issue may be because I don't have admin access, anyone any idea how to get rid of this error or install gatsby globally without admin access or if I dont install globally then how to use gatsby command on CLI
You need admin access for installing global packages. However, you can install gatsby-cli on your local machine (where you have admin access), then gatsby build to generate a public directory. Finally, you can deploy your website by copying the public directory to the web server that you don't have admin access to it, for example, by using scp.
Related
I work in an offline network and I want to be able to type
npm install <package-name>
and then, a request to a local server inside my network will be sent to download the package.
What is the best way I can implement it?
Thanks
You can setup local git server on your local network and store your package on local git server then you can install the package by
npm install https://gitserverip/user_name/package.git
I came across d3ML.js. However, it's not in the npm registry so I can't directly install it. Is there any other to install & use it in a React.js project?
I have installed few npm packages globally but it does not show any dependencies in any of my package.json files. Which npm command should I use to apply dependencies in all of my package.json files?
Globally installed dependencies won't list in your local package.json file. You should still be able to use them requiring/importing into your project.
if you want to save a dependency in your package.json as well when you install it, us --save flag with npm install command.
for example
npm install --save express
It is not recommended to add a package which is installed globally to locally or vice versa.
When a package is installed globally, it is normally used as a command in the terminal. For example, create-react-app or express-generator. You might install these packages globally to use them as commands in the terminal to build React or Express app (with default scaffold).
When a package is installed locally, it means you want to use it within the application. For example, jsonwebtoken. You should install this package locally so that it can be used within the application and when somebody else clones your project they can install this package as well via npm install command.
So, the suggestion is, install the package globally if you're going to use it as a command, else install the package locally within the application. Don't mix them.
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`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