Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postinstall problems 6.4.5 #1117

Closed
mdevDE opened this issue Mar 11, 2020 · 13 comments
Closed

Postinstall problems 6.4.5 #1117

mdevDE opened this issue Mar 11, 2020 · 13 comments

Comments

@mdevDE
Copy link

mdevDE commented Mar 11, 2020

Hi there,
when using version 6.4.4 the post installation works fine.

However, updating to version 6.4.5 will show the following error:

  • npm ERR! nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
  • npm ERR! Failed at the nodemailer@6.4.5 postinstall script

Thanks in advance

@ficzusistvan
Copy link

Same situation for me.

@andris9
Copy link
Member

andris9 commented Mar 11, 2020

Can not reproduce. Could you try figuring out why this happens (maybe some system specific requirements) and propose a fix?

@mdevDE
Copy link
Author

mdevDE commented Mar 11, 2020

Hi andris9,

I am no expert, however, this is what the error log says. Maybe this is of any help

100 verbose stack Error: nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
100 verbose stack spawn ENOENT
100 verbose stack at ChildProcess. (/opt/plesk/node/12/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
100 verbose stack at ChildProcess.emit (events.js:200:13)
100 verbose stack at maybeClose (internal/child_process.js:1021:16)
100 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
101 verbose pkgid nodemailer@6.4.5
102 verbose cwd /var/www/vhosts/hosting107605.a2f15.netcup.net/srv.huwaldroether.de/dist
103 verbose Linux 4.9.0-0.bpo.9-amd64
104 verbose argv "/opt/plesk/node/12/bin/node" "/opt/plesk/node/12/bin/npm" "install"
105 verbose node v12.4.0
106 verbose npm v6.9.0
107 error file sh
108 error code ELIFECYCLE
109 error errno ENOENT
110 error syscall spawn
111 error nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
111 error spawn ENOENT
112 error Failed at the nodemailer@6.4.5 postinstall script.

The strange thing is that versions 6.4.0 - 6.4.4 worked just fine.

@andris9
Copy link
Member

andris9 commented Mar 12, 2020

It seems that node binary is not available in default path

@jakeleventhal
Copy link

furthermore, there are no release notes for 6.4.5

@ybatsiun
Copy link

I faced the same issue

@JaffaKetchup
Copy link

Hi andris9,

I am no expert, however, this is what the error log says. Maybe this is of any help

100 verbose stack Error: nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
100 verbose stack spawn ENOENT
100 verbose stack at ChildProcess. (/opt/plesk/node/12/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
100 verbose stack at ChildProcess.emit (events.js:200:13)
100 verbose stack at maybeClose (internal/child_process.js:1021:16)
100 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
101 verbose pkgid nodemailer@6.4.5
102 verbose cwd /var/www/vhosts/hosting107605.a2f15.netcup.net/srv.huwaldroether.de/dist
103 verbose Linux 4.9.0-0.bpo.9-amd64
104 verbose argv "/opt/plesk/node/12/bin/node" "/opt/plesk/node/12/bin/npm" "install"
105 verbose node v12.4.0
106 verbose npm v6.9.0
107 error file sh
108 error code ELIFECYCLE
109 error errno ENOENT
110 error syscall spawn
111 error nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
111 error spawn ENOENT
112 error Failed at the nodemailer@6.4.5 postinstall script.

The strange thing is that versions 6.4.0 - 6.4.4 worked just fine.

Yep. I installed 6.4.4 without an issue. Thanks!

@cchretien
Copy link

Not sure if this helps but I was hitting a similar issue due to the introduction of that postinstall script. After digging a little more, I found it was because I was building with an Alpine image and I use root inside the container to install my packages.
linuxserver/docker-baseimage-alpine#47
I set ENV npm_config_unsafe_perm=true in my Dockerfile to workaround

@andris9
Copy link
Member

andris9 commented May 28, 2020

Make sure that node binary is available in default path or disable scripts: npm install --ignore-scripts

@andris9 andris9 closed this as completed May 28, 2020
@brunamagrinidacruz
Copy link

Same problem here doing npm install nodemailer. Installed npm install nodemailer@6.4.4 and worked it.

@JaffaKetchup
Copy link

I think this issue is not resolved and should be reopened.

Why does 6.4.5 exist if there are no release notes (thanks to @jakeleventhal)? Why does 6.4.4 work perfectly without error? This shouldn't be ignored considering how big this project is, and how many of us are clearly struggling with this issue.
I hope my reasons are clear, and to anybody looking for help, install 6.4.4, but we can't just ignore this issue.

Thanks,
Luka S.

@andris9
Copy link
Member

andris9 commented Jun 29, 2020

Even though this project may seem big, it is not a community project but my personal project that I have been building from my spare time for the last 10 years. CHANGELOG does not include every released version mostly because I haven't been always consistent and ofter forget to add an entry.

Post-install script does not work if node binary is not available from global $PATH. There are multiple solutions to overcome this:

  • Make sure that node binary is available from global $PATH (preferred solution)
  • Fork Nodemailer and remove post-install script from package.json
  • I have a sponsorship tier in Github that once reached, also removes the post-install script
  • Do not run npm scripts when installing modules (npm install --ignore-scripts)
  • Use an alternative module like emailjs that does not have such post-install script.

@inceabdullah
Copy link

Hi andris9,

I am no expert, however, this is what the error log says. Maybe this is of any help

100 verbose stack Error: nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
100 verbose stack spawn ENOENT
100 verbose stack at ChildProcess. (/opt/plesk/node/12/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
100 verbose stack at ChildProcess.emit (events.js:200:13)
100 verbose stack at maybeClose (internal/child_process.js:1021:16)
100 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
101 verbose pkgid nodemailer@6.4.5
102 verbose cwd /var/www/vhosts/hosting107605.a2f15.netcup.net/srv.huwaldroether.de/dist
103 verbose Linux 4.9.0-0.bpo.9-amd64
104 verbose argv "/opt/plesk/node/12/bin/node" "/opt/plesk/node/12/bin/npm" "install"
105 verbose node v12.4.0
106 verbose npm v6.9.0
107 error file sh
108 error code ELIFECYCLE
109 error errno ENOENT
110 error syscall spawn
111 error nodemailer@6.4.5 postinstall: node -e "try{require('./postinstall')}catch(e){}"
111 error spawn ENOENT
112 error Failed at the nodemailer@6.4.5 postinstall script.

The strange thing is that versions 6.4.0 - 6.4.4 worked just fine.

Thank you I have got that error with npm i nodemailer but not: npm i nodemailer@6.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants