Comments (5)
@nfischer, I am expecting the
code
to return any non-zero (success).
You have that backward. 0 means success. Non-zero means failure. This is the standard unix convention.
what i think is that, shelljs is expecting a node of version <14.7.0 installed on my pc while am having v19.2.0 installed, and if i installed node <14.7.0 my electron wouldn't run.
ShellJS should be compatible with either nodejs version. The error message is not coming from ShellJS though. The error message is coming from the npm
binary. See the below error message:
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '<14.7.0' },
This means that npm
is running using nodejs 19.2.0. No problem so far, but you're running the npm install
command and this is installing [email protected]
. The node-abort-controller
project claims it is incompatible with node > 14.7.0. It indicates this compatibility in its package.json file using the engines
attribute. npm
realizes that the package wants node < 14.7.0 but you're using node > 14.7.0, so it prints npm WARN EBADENGINE
to tell you this is a problem. Take a look at this documentation: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#engines
BTW you should take a look at https://www.npmjs.com/package/node-abort-controller. This page says you should not use the package if you're using node > 14.7.0 (and it explains why).
if I open a terminal and run
npm install
i got the result as:
The only explanation for this is that you have configured ShellJS differently than your terminal environment. I can think of 2 possible explanations:
- Your terminal is running npm using a lower NodeJS version. If this is the case, then you should probably either upgrade that node version or configure ShellJS to use that same node version (you can choose whichever option you prefer); or
- You have configured npm (in the terminal) to ignore the
package.engines
warning and have configured npm (when run by ShellJS) to check this warning. It could be the case that you've done so accidentally; maybe there is some configuration in your dotfiles, something configured bynvm
(if you're using that sort of thing), or maybe even npm itself is configured to behave differently in an interactive session.
Either way, this isn't something we'll be able to support in shell.exec()
. This sounds like it's best to check your environment.
from shelljs.
It looks to me like the npm install
command is providing warning output and shell.exec()
is printing this output as you have coded. Can you explain what you were expecting to happen instead?
from shelljs.
@nfischer, I am expecting the code
to return any non-zero (success). what i think is that, shelljs is expecting a node of version <14.7.0 installed on my pc while am having v19.2.0 installed, and if i installed node <14.7.0 my electron wouldn't run.
from shelljs.
if I open a terminal and run npm install
i got the result as:
`npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
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]: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
added 233 packages, and audited 385 packages in 41s
5 packages are looking for funding
run `npm fund` for details
21 vulnerabilities (11 moderate, 8 high, 2 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.`
-- but if i use shelljs to execute the npm install
i got this error:
STDERR: npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '<14.7.0' },
npm WARN EBADENGINE current: { node: 'v19.2.0', npm: '7.24.2' }
npm WARN EBADENGINE }
from shelljs.
@nfischer thank you, I was mistaken, I told 0 was failed, I have already moved with that. Thank you
from shelljs.
Related Issues (20)
- Sdtout is empty if using another shell
- Using exec does not terminate the command process HOT 1
- Codecov broken on CI
- Shell.exec() freezes HOT 6
- Feature request (cp): -v flag for verbose output HOT 3
- Feature request (true, false) HOT 1
- test-with-coverage is broken on node v16 HOT 1
- `cd.js` swallows the initial error HOT 1
- "TypeError: common.register is not a function" under node v20.6.0 HOT 13
- GitHub actions dropping support for node < 16
- Exec failure on Node 21 HOT 1
- In mv command, there should be en error if destination directory not present. HOT 1
- shell.exec(`mv a/m.js b/`) cannot return error stdout HOT 2
- Latest shelljs type definitions have errors HOT 1
- Vulnerability in shelljs dependency: CWE-772: Missing Release of Resource after Effective Lifetime HOT 4
- shelljs.exec or child_process.exec not executing HOT 2
- Shelljs EXEC does not work when running a pre-compiled binary application HOT 4
- Attempted to import the Node standard library module "fs" HOT 1
- A problem with cd outside the project HOT 3
- `exec-child.js` module not found, when running `shell.exec()` on Next.js Server Actions
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 shelljs.