nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

npm install nw not working

Open yaser-alazm opened this issue 5 years ago • 3 comments

NWJS Version : 0.44.2-sdk Operating System : Ubuntu 19.10

Expected behavior

I want to install the package to try it for my project with : sudo npm install -D nw

Actual behavior

but what actually happens is that the package install fails with this error :

` [email protected] postinstall /home/yaser-work/Documents/projects/nw-js-desktop app/node_modules/nw > node scripts/install.js unexpected end of file npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node scripts/install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. `

Also I tried using --unsafe-perm with npm command to avoid any expected permission issues and tried different versions of NW package but still have this problem! The problem happens just with this package, meaning that when i install any other package on my project it works with no errors at all.

Thanks

yaser-alazm avatar Feb 20 '20 21:02 yaser-alazm

I had the similar problem that it was stucking at postscript (node script/install.js), my solution was downloading nw manually and copieng its content (where excutable is) to nwjs folder inside nw module. then using nw . and worked!

arasrezaei avatar Feb 27 '20 06:02 arasrezaei

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 10:01 stale[bot]

Please fix the module. Add the install.js to nw/scripts. It is impossible to init nwjs on MacOS from scratch.

I was able to add it with pre-existing install.js from my Windows machine and add it to place where it's missing with following: npm install --ignore-scripts && cp platform-fix/install.js node_modules/nw/scripts/ && npm install nw

Then I had to add nwjs.app to /node_modules/nw/nwjs

garys-primary avatar Aug 07 '23 19:08 garys-primary