charlesguse/run-script-os

npm run scriptname doesn't work

Rosentti opened this issue · 5 comments

Output of npm run builddeps



> project@1.0.0 builddeps
> run-script-os

This is meant to be run from within npm script. See https://github.com/charlesguse/run-script-os

My package.json scripts

 "scripts": {
    "builddeps": "run-script-os",
    "builddeps:linux": "sh builddeps.sh",
    "builddeps:win32": "builddeps.bat",
    "build": "webpack -p",
    "start": "webpack && qode ./dist/index.js",
    "debug": "webpack && qode --inspect ./dist/index.js",
    "tsc": "tsc"
  },

From what I can tell, it should work?

You are correct. That should work. Are you using NPM v7.1+ It looks like there was a change in NPM as mentioned in issue #34. The current workaround would be to downgrade NPM or please feel free to submit a PR with a fix.

Assuming you are using NPM v7.1+, I will comment here when it's fixed.

@charlesguse - Hi, is there an estimated timeline for this fix? I'm currently experiencing the same behaviour. Please advise soonest, sir.

https://github.com/npm/rfcs/blob/latest/implemented/0021-reduce-lifecycle-script-environment.md

this is a breaking change from npm. A better error message in the short term would at least be nice

If I have time I'll try to open a pr that looks for npm version

This has been fixed with the most recent release of run-script-os (1.1.5)