GithubHelp home page GithubHelp logo

Comments (5)

nfischer avatar nfischer commented on June 14, 2024 2

@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:

  1. 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
  2. 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 by nvm (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.

nfischer avatar nfischer commented on June 14, 2024

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.

abbaty48 avatar abbaty48 commented on June 14, 2024

@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.

abbaty48 avatar abbaty48 commented on June 14, 2024

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.

abbaty48 avatar abbaty48 commented on June 14, 2024

@nfischer thank you, I was mistaken, I told 0 was failed, I have already moved with that. Thank you

from shelljs.

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.