Comments (6)
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.
@canadaduane Thanks for reporting it. Still I've just tested it and installation worked without issues:
from es5-ext.
Do you have node
in your PATH?
from es5-ext.
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.
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.
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)
- v0.10.54 release breaks package installation HOT 25
- The NPM package is not a place for politics HOT 7
- Reasoning for anti-war manifest HOT 609
- On manifestations :) HOT 6
- Perhaps, some improvements to wording HOT 4
- Unfortunately the protest-ware in the manifest means your package has been marked as critical HOT 2
- Postinstall not fit for Windows HOT 23
- This is not malware, but... HOT 1
- package being detected as a virus HOT 52
- npm ERR! code EINTEGRITY HOT 2
- Violation of Security-Malicious HOT 8
- Error: ELOOP: too many symbolic links encountered HOT 2
- fu'ed postinstall message HOT 2
- Clean repo from Malware scripts HOT 1
- Move "call for peace" to `README.md` to avoid unintended consequences HOT 1
- redos in es5-ext HOT 24
- Why you don't call for peace in Gaza? HOT 1
- Failed to exec postinstall script on Linux HOT 5
- Can't install on linux HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es5-ext.