install nwjs dev version automaticaly when npm i

379 Views Asked by At

is there a way to install dev version of nwjs automatically from package.json like when I type npm install?

Like when i type npm i nw --nwjs_build_type=sdk

I tried setting environment variable like this in package.json:

"scripts": {
"preinstall": "set NWJS_BUILD_TYPE=sdk"}

but it did not work?

2

There are 2 best solutions below

1
On
npm install 

install all required dependencies of node project. if you want to add another package then you have to install specific package

For Example :

npm i nwjs

or

npm i [package name, another Package name]
0
On

I created new file .npmrc and pasted this:

nwjs_build_type=sdk