Coder Social home page Coder Social logo

Comments (6)

matthijs-oosterhoff avatar matthijs-oosterhoff commented on May 29, 2024 1

I'm running into a similar issue. I have a a Docker image with a build environment for some legacy application. The Docker image installs gulp-cli, which has a dependency on es5-ext. Building that Docker image recently started failing and I pinpointed the issue to the _postinstall.js of es5-ext. Below you'll find a Dockerfile to reproduce the issue. This is a stripped down version of the one I use for my legacy Gulp application. It just installs es5-ext on top of Node 10 / NPM 7 from NVM.

FROM ubuntu:20.04

RUN apt-get update && apt-get install -y curl

ENV NVM_VERSION 0.39.1
ENV NODE_VERSION 10.22.1
ENV NPM_VERSION 7.24.0

RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v$NVM_VERSION/install.sh | bash \
    && chmod u+x /root/.nvm/nvm.sh \
    && . /root/.nvm/nvm.sh \
    && nvm install v$NODE_VERSION \
    && nvm use v$NODE_VERSION

ENV PATH="${PATH}:/root/.nvm/versions/node/v${NODE_VERSION}/bin"
RUN npm install -g npm@$NPM_VERSION

RUN npm install -g es5-ext

Output of docker build -t reproducer .:

(...)
Step 10/10 : RUN npm install -g es5-ext
 ---> Running in 3fd48e6dd463
npm notice 
npm notice New major version of npm available! 7.24.0 -> 8.6.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.6.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v10.22.1/lib/node_modules/es5-ext
npm ERR! command failed
npm ERR! command sh -c  node -e "try{require('./_postinstall')}catch(e){}"
npm ERR! sh: node: command not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-04-11T09_41_12_866Z-debug.log
The command '/bin/sh -c npm install -g es5-ext' returned a non-zero code: 127

The error as mentioned in the debug.log:

(...)
112 verbose stack Error: command failed
112 verbose stack     at ChildProcess.proc.on (/root/.nvm/versions/node/v10.22.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
112 verbose stack     at ChildProcess.emit (events.js:198:13)
112 verbose stack     at maybeClose (internal/child_process.js:982:16)
112 verbose stack     at Socket.stream.socket.on (internal/child_process.js:389:11)
112 verbose stack     at Socket.emit (events.js:198:13)
112 verbose stack     at Pipe._handle.close (net.js:607:12)
113 verbose pkgid [email protected]
114 verbose cwd /
115 verbose Linux 5.4.0-107-generic
116 verbose argv "/root/.nvm/versions/node/v10.22.1/bin/node" "/root/.nvm/versions/node/v10.22.1/bin/npm" "i" "-g" "es5-ext"
117 verbose node v10.22.1
118 verbose npm  v7.24.0
119 error code 127
120 error path /root/.nvm/versions/node/v10.22.1/lib/node_modules/es5-ext
121 error command failed
122 error command sh -c  node -e "try{require('./_postinstall')}catch(e){}"
123 error sh: node: command not found
124 verbose exit 127

As far as I am aware, node is on the PATH in the container. See line 16 of the Dockerfile, as wel as:

root@40d8b784b511:/# echo $PATH
/root/.nvm/versions/node/v10.22.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.nvm/versions/node/v10.22.1/bin
root@40d8b784b511:/# which node 
/root/.nvm/versions/node/v10.22.1/bin/node

I noticed 122 error command sh -c node -e "try{require('./_postinstall')}catch(e){}" in the debug log, which seems like an attempt to prevent the political script from breaking builds if anything misbehaves. I think another fallback may need to be added. I have nothing against these political statements in open source projects, but IMHO they should not break existing configurations.

from es5-ext.

medikoo avatar medikoo commented on May 29, 2024

@canadaduane Thanks for reporting it. Still I've just tested it and installation worked without issues:

Screenshot 2022-04-09 at 09 47 38

from es5-ext.

canadaduane avatar canadaduane commented on May 29, 2024

Do you have node in your PATH?

from es5-ext.

maddocnc avatar maddocnc commented on May 29, 2024

Same error.

npm ERR! command sh -c  node -e "try{require('./_postinstall')}catch(e){}"
npm ERR! sh: 1: node: Permission denied

Also using nvm.

Please consider something like this #180

from es5-ext.

jordanambra avatar jordanambra commented on May 29, 2024

Also having this issue in a GitHub Action that installs the latest versions of serverless and serverless-python-requirements, which has a dependency of es5-ext.

from es5-ext.

medikoo avatar medikoo commented on May 29, 2024

Sorry for the late response, I was on vacation last week.

I believe I've fixed that with v0.10.61 (just published). If you still see any issues please report
.

from es5-ext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.