mailtrain icon indicating copy to clipboard operation
mailtrain copied to clipboard

Ubuntu Install fails from script (Failed at the [email protected] postinstall script)

Open SAShapeShifter opened this issue 6 years ago • 4 comments

Hi All im trying to install mailtrain beta on ubuntu.18.04.

When i run the script it downloads everything But fails at node-saas and node-gpy. I read online that you could use --unsafe-perm However that does not work even if i run npm install --unsafe-perm -g node-sass npm install --unsafe-perm -g node-gpy

the run bash/reinstall

it still fails.

How can i get this installed please. I am running as root

`> [email protected] postinstall /opt/mailtrain/client/node_modules/node-sass

node scripts/build.js

Building: /usr/bin/node /opt/mailtrain/client/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= gyp info it worked if it ends with ok gyp verb cli [ '/usr/bin/node', gyp verb cli '/opt/mailtrain/client/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '--verbose', gyp verb cli '--libsass_ext=', gyp verb cli '--libsass_cflags=', gyp verb cli '--libsass_ldflags=', gyp verb cli '--libsass_library=' ] gyp info using [email protected] gyp info using [email protected] | linux | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb check python checking for Python executable "python2" in the PATH gyp verb which succeeded python2 /usr/bin/python2 gyp verb check python version /usr/bin/python2 -c "import sys; print "2.7.17 gyp verb check python version .%s.%s" % sys.version_info[:3];" returned: %j gyp verb get node dir no --target version specified, falling back to host node version: 10.19.0 gyp verb command install [ '10.19.0' ] gyp verb install input version string "10.19.0" gyp verb install installing version: 10.19.0 gyp verb install --ensure was passed, so won't reinstall if already installed gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/10.19.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/mailtrain/client/node_modules/node-sass/.node-gyp" gyp verb tmpdir == cwd automatically will remove dev files after to save disk space gyp verb command install [ '--node_gyp_internal_noretry', '10.19.0' ] gyp verb install input version string "10.19.0" gyp verb install installing version: 10.19.0 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version not already installed, continuing with install 10.19.0 gyp verb ensuring nodedir is created /opt/mailtrain/client/node_modules/node-sass/.node-gyp/10.19.0 gyp WARN install got an error, rolling back install gyp verb command remove [ '10.19.0' ] gyp verb remove using node-gyp dir: /opt/mailtrain/client/node_modules/node-sass/.node-gyp gyp verb remove removing target version: 10.19.0 gyp verb remove removing development files for version: 10.19.0 gyp WARN install got an error, rolling back install gyp verb command remove [ '10.19.0' ] gyp verb remove using node-gyp dir: /opt/mailtrain/client/node_modules/node-sass/.node-gyp gyp verb remove removing target version: 10.19.0 gyp verb remove removing development files for version: 10.19.0 gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/mailtrain/client/node_modules/node-sass/.node-gyp' gyp ERR! System Linux 4.15.18-26-pve gyp ERR! command "/usr/bin/node" "/opt/mailtrain/client/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /opt/mailtrain/client/node_modules/node-sass gyp ERR! node -v v10.19.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok Build failed with error code: 1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node scripts/build.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.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-03-25T03_16_04_971Z-debug.log root@atsnews:/opt/mailtrain# npm install --unsafe-perm -g node-sass node-gyp npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 /usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js /usr/bin/node-sass -> /usr/lib/node_modules/node-sass/bin/node-sass `

SAShapeShifter avatar Mar 25 '20 03:03 SAShapeShifter

I just experienced exactly the same problem. Tried to manually set permissions on both client dir and /root/.node-gyp, without a result. What I did wrong was run the setup script directly like:

( usually I'm using bash terminal, hence why the direct invocation ) ./setup/install-ubuntu18.. domains..

instead of sudo bash setup/install-ubuntu18 .. domains..

When executed the latter it all went fine.

the-aleks avatar Oct 08 '20 15:10 the-aleks

I am experiencing this problem on CentOS 7 as well.

I invoked the script like sudo bash setup/install-centos7-https.sh ...

evanm avatar Oct 08 '20 17:10 evanm

I am experiencing this problem on CentOS 7 as well.

I invoked the script like sudo bash setup/install-centos7-https.sh ...

This was my fault, as I should have followed the advice at the top of the install steps

Login as root. (I had some problems running npm as root on CentOS 7 on AWS. This seems to be fixed by the seemingly extraneous su within sudo.)

sudo su -

evanm avatar Oct 08 '20 19:10 evanm

@SAShapeShifter @evanm I am writing an ansible-playbook for this. This will help to install also with the right user and right order.

You are welcome to test it if you want as soon as it is ready.

forgeOneHQ avatar Aug 29 '21 22:08 forgeOneHQ