Closed goosewood closed 5 years ago
Odd that it’s a permission error. Could you try installing it in a directory you own? It should matter because of sudo, but who knows
-- R
Il giorno 22 giugno 2018 @ 16:22:57, Goosewood (notifications@github.com) ha scritto:
$ sudo npm i -verbose npm info it worked if it ends with ok npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'i', '-verbose' ] npm info using npm@6.1.0 npm info using node@v9.10.0 npm verb npm-session 0910e1be8b356b97 npm info lifecycle snwe@0.1.0-rc.2~preinstall: snwe@0.1.0-rc.2 npm timing stage:loadCurrentTree Completed in 3202ms npm timing stage:loadIdealTree:cloneCurrentTree Completed in 23ms npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1508ms npm http fetch GET 304 https://registry.npmjs.org/electron 218ms (from cache) npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 2124ms npm timing stage:loadIdealTree Completed in 4257ms npm timing stage:generateActionsToTake Completed in 144ms npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing npm verb lock using /root/.npm/_locks/staging-d5f93b0f7f1f3b4d.lock for /home/void/Scripts/snwe/node_modules/.staging npm timing audit compress Completed in 19ms npm info audit Submitting payload of 21715bytes npm timing action:extract Completed in 114ms npm timing action:finalize Completed in 7ms npm timing action:refresh-package-json Completed in 15ms npm info lifecycle electron@2.0.3~preinstall: electron@2.0.3 npm timing action:preinstall Completed in 1ms npm info linkStuff electron@2.0.3 npm verb linkBins [ { electron: 'cli.js' }, npm verb linkBins '/home/void/Scripts/snwe/node_modules/.bin', npm verb linkBins false ] npm timing action:build Completed in 15ms npm info lifecycle electron@2.0.3~install: electron@2.0.3 npm timing action:install Completed in 3ms npm info lifecycle electron@2.0.3~postinstall: electron@2.0.3
electron@2.0.3 postinstall /home/void/Scripts/snwe/node_modules/electron> node install.js
/home/void/Scripts/snwe/node_modules/electron/install.js:47 throw err ^
Error: EACCES: permission denied, mkdir '/home/void/Scripts/snwe/node_modules/electron/.electron' npm verb lifecycle electron@2.0.3~postinstall: unsafe-perm in lifecycle false npm verb lifecycle electron@2.0.3~postinstall: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/void/Scripts/snwe/node_modules/electron/node_modules/.bin:/home/void/Scripts/snwe/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:/opt/texlive/2018/bin/x86_64-linux npm verb lifecycle electron@2.0.3~postinstall: CWD: /home/void/Scripts/snwe/node_modules/electron npm info lifecycle electron@2.0.3~postinstall: Failed to exec postinstall script npm timing action:postinstall Completed in 481ms npm verb unlock done using /root/.npm/_locks/staging-d5f93b0f7f1f3b4d.lock for /home/void/Scripts/snwe/node_modules/.staging npm timing stage:rollbackFailedOptional Completed in 5ms npm timing stage:runTopLevelLifecycles Completed in 8908ms npm verb stack Error: electron@2.0.3 postinstall:
node install.js
npm verb stack Exit status 1 npm verb stack at EventEmitter.(/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16) npm verb stack at EventEmitter.emit (events.js:180:13) npm verb stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) npm verb stack at ChildProcess.emit (events.js:180:13) npm verb stack at maybeClose (internal/child_process.js:936:16) npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) npm verb pkgid electron@2.0.3 npm verb cwd /home/void/Scripts/snwe npm verb Linux 4.16.14_1 npm verb argv "/usr/bin/node" "/usr/bin/npm" "i" "-verbose" npm verb node v9.10.0 npm verb npm v6.1.0 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! electron@2.0.3 postinstall: node install.js
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the electron@2.0.3 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm verb exit [ 1, true ] npm timing audit submit Completed in 1251ms npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1249ms npm timing audit body Completed in 2ms npm timing npm Completed in 10033msnpm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-06-22T14_13_00_568Z-debug.log
Creating the folder it throws the error on doesn't help beause it's a postinstall thing and I believe the directory is re-written each time. I'm not really sure why it's returning a permission problem when run as sudo. The fact that it returns my LaTeX installation filepath seems questionable, but I'm honestly not that fimiliar with how npm works so I don't think I can make judgment on that. Reading the log file doesn't really add new information, as it has the same fail message.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blahsd/snwe/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/AHAcmTTd8g7lox6H9DcX0pTM8R1YOr1Cks5t_P3BgaJpZM4Uz4d5 .
@blahsd It's in my home folder... Lemme see if my other machine throws the same error
Yeah I get the same error on my other system (I tried it on another distro too, but for the life of me I don't know how to get npm to install properly on debian. The nodejs package is funny with aptitude I guess and I don't have time to deal with it)
Well. This is awkward – I didn't realise you were on linux. I'm gonna try looking into this in the weekend, but I don't have a linux machine, nor snwe has ever been run on linux. It's all been macOS based so far.
If you get it tu run though, I would love to know how to fix it so linux users can get in on this too!
Figured I'd try it out as it would probably go well on my dwm rice. I might be missing some dependancy somewhere. I'll report back it I find anything!
Could you please try npm install
again but downloading from branch iss35
instead? It might be fixed.
@blahsd Nope, same error
Shit. Nevermind, back to work. Thanks for testing @goosewood
Might be a dependancy thing. Any clue what?
I just tried again on a gentoo system and got the same error @blahsd. Probably a code-base thing as I have all npm use flags on...
Please forgive me if I'm grasping at straws a bit. Unfortunately at this time I have not even one device running linux, so everything is extremely tentative.
I'm guessing the following (please take with a pinch of salt):
npm install
spawns separate processes (the install scripts) which, even if you run the former as superuser, are run as non-superuser child processessudo
or not npm install
npm install --unsafe-perm
or npm install --unsafe-perm=true
. This should suppress the warnings and let you install. Possibly this latter command should be sudo
ed too. On --unsafe-perm
, it's written that:
con: install scripts are run as root, and you probably did not read them all to make sure they are safe
pro: without them, no install script can write to disk in its own module folder, so unless the install script does nothing but print some things to standard out, the modules you need will not install
Assuming the workaround worked or it's not of further interest. Feel free to reopen.
Creating the folder it throws the error on beforehand doesn't help beause it's a postinstall thing and I believe the directory is re-written each time. I'm not really sure why it's returning a permission problem when run as sudo. The fact that it returns my LaTeX installation filepath seems questionable, but I'm honestly not that familiar with how npm works so I don't think I can make judgment on that. Reading the log file doesn't really add new information, as it has the same fail message.