EDIT from maintainer @ronjouch: see https://github.com/jiahaog/nativefier/issues/923#issuecomment-599300317 for details. I'm working on a fix (probably reverting to webpacking the placeholder app at build time, see https://github.com/jiahaog/nativefier/pull/898#issuecomment-583865045). Until then, you should:
npm install nativefier, then invoke it with node ./node_modules/.bin/nativefier <your-options-here>)...npm_config_prefix to somewhere user-writable and npm install -g nativefier without sudo.I am trying to install Nativefier and it keeps failing. I am on Lubuntu 19.10, have the latest verison of nodejs and npm.
Error in terminal:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `cd app && yarn install --no-lockfile --no-progress --silent`
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.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-03-15T23_58_29_502Z-debug.log
@BananaManCJ thanks. Confirmed at https://github.com/jiahaog/nativefier/issues/719#issuecomment-599276007 . Looking, all help / ideas / additional debug info welcome.
I'm having the same problem with Ubuntu 19.10 Gnome.
Maybe is something specific with Ubuntu? :thinking:
I can check to see if this is a Ubuntu-specific issue, I have a Mac
I can check to see if this is a Ubuntu-specific issue, I have a Mac
@BananaManCJ yes please, on my side looking on a Windows machine. Thanks 馃檹.
Can confirm that the error occurs on MacOS
It outputs more information on MacOS
Output:
warning Skipping preferred cache folder "/Users/rosefam/Library/Caches/Yarn" because it is not writable.
warning Skipping preferred cache folder "/usr/local/lib/node_modules/nativefier/.yarn-cache-4294967294" because it is not writable.
warning Skipping preferred cache folder "/usr/local/lib/node_modules/nativefier/.yarn-cache" because it is not writable.
error Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: cd app && yarn install --no-lockfile --no-progress --silent
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.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rosefam/.npm/_logs/2020-03-16T00_20_23_351Z-debug.log
On my side,
> [email protected] postinstall /usr/local/lib/node_modules/nativefier
> cd app && yarn install --no-lockfile --no-progress --silent
Error: EACCES: permission denied, open '/root/.config/yarn'
at Object.openSync (fs.js:439:3)
at readFileSync (fs.js:344:35)
at /usr/local/lib/node_modules/nativefier/node_modules/yarn/lib/cli.js:101331:58
at Array.map (<anonymous>)
at parseRcPaths (/usr/local/lib/node_modules/nativefier/node_modules/yarn/lib/cli.js:101329:78)
at Object.findRc (/usr/local/lib/node_modules/nativefier/node_modules/yarn/lib/cli.js:101343:10)
at getRcConfigForCwd (/usr/local/lib/node_modules/nativefier/node_modules/yarn/lib/cli.js:56915:74)
at /usr/local/lib/node_modules/nativefier/node_modules/yarn/lib/cli.js:92694:56
at Generator.next (<anonymous>)
at step (/usr/local/lib/node_modules/nativefier/node_modules/yarn/lib/cli.js:310:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `cd app && yarn install --no-lockfile --no-progress --silent`
Using yarn to bundle the electron app was added with 8.x, after long discussion summed up at https://github.com/jiahaog/nativefier/pull/898#issuecomment-583865045 . Trying to see if we can make this work, of considering coming back to Webpacking the app 馃槙.
It shows this yarn error here too.
I'm installing Fedora 31 here, and I'll try again...
@raulcraveiro @BananaManCJ can you try installing with environment variable YARN_CACHE_FOLDER set to /tmp? So, sudo YARN_CACHE_FOLDER=/tmp npm install -g nativefier
Just tried, got the same error :/ @ronjouch
On Linux or MacOS @ronjouch
On Linux or MacOS @ronjouch
@BananaManCJ both welcome. Thanks 馃檪.
WOAH, got a bigger error message this time
https://pastebin.com/FaHdP602
@BananaManCJ yeah, samed as the one I got in a Docker:
Error: EACCES: permission denied, open '/root/.config/yarn'
at Object.openSync (fs.js:439:3)
at readFileSync (fs.js:344:35)
at /home/rosefam/nativefier/node_modules/yarn/lib/cli.js:101331:58
at Array.map (<anonymous>)
at parseRcPaths (/home/rosefam/nativefier/node_modules/yarn/lib/cli.js:101329:78)
at Object.findRc (/home/rosefam/nativefier/node_modules/yarn/lib/cli.js:101343:10)
at getRcConfigForCwd (/home/rosefam/nativefier/node_modules/yarn/lib/cli.js:56915:74)
at /home/rosefam/nativefier/node_modules/yarn/lib/cli.js:92694:56
at Generator.next (<anonymous>)
at step (/home/rosefam/nativefier/node_modules/yarn/lib/cli.js:310:30)
I don't see a /root/.config/yarn folder on my system, am I missing a dependency?
I don't see a /root/.config/yarn folder on my system, am I missing a dependency?
@BananaManCJ nope, you're good, the problem is on yarn, not you. I'm preparing a workaround, keeping you posted.
Just tried on Fedora 31, getting the same error :/
@BananaManCJ @raulcraveiro I published a workaround, can you give it a try? npm install -g [email protected]
The workaround will introduce a 60s delay at installation time, but give it time and it should finish. Waiting for your feedback.
EDIT gaaaah, maybe not actually, I get this error in my Ubuntu 19.10 Docker. Well, give it a try anyway if you have the time, maybe it works for you.
glob error { [Error: EACCES: permission denied, scandir '/root/.npm/_logs']
stack:
'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/root/.npm/_logs' }
@ronjouch
I got this error:
`
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN checkPermissions Missing write access to /usr/local/lib
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib'] {
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/lib'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/raul/.npm/_logs/2020-03-16T01_19_44_911Z-debug.log
`
@ronjouch I get the same error, I think @raulcraveiro forgot to run npm as root
I also tried running sudo npm install -g [email protected] and got the same error as 8.0.2
Edit: also in 8.0.0
Okay yes, still broken. My understanding so far:
$npm_config_prefix is set to "$HOME/.node_modules")sudo npm i -g nativefier,postinstall tries to do its job of installing app deps, and fails in various OS-dependent ways, but all about access rights.su with access rights to system paths, postinstall scripts are run out of su. That would make sense for security reasons: out of hook scripts, npm knows exactly what will be touched in your filesystem: it's the static contents of the published tarball; a postinstall script with sudo rights could do nasty dynamic stuff. So, although I don't see any mention of that in npm-scripts docs / hooks and I haven't dug npm/cli's code, I can understand it.So, I'm going to sleep on that, and next week I'll revert back to webpacking the placeholder app (or do something else if I/someone has a better idea). Until then, stay with 7.7.1 or install non-globally 馃檪. I'm adding this blurb to the issue description, and mentioned the issue in the 8.0.3 release description.
Thanks for the feedback everybody!
No problem!
Thank you for the attention! If you need any help testing on Ubuntu, I can help ;)
Getting the same issue in macOS with ohmyzsh.
Here's the log file:
2020-03-16T11_57_04_480Z-debug.log
@BananaManCJ @raulcraveiro @remissao @cwensel issue should be fixed in Nativefier 8.0.4 just published on npm! Confirmed working in my Ubuntu 19.10 docker. Please npm install -g [email protected] and confirm 馃檪.
It worked! Thank you so much ;)
It worked! Thank you so much ;)
@raulcraveiro yayyyyy welcome 馃檪. Thank you and thanks everyone here for the feedback!