jashkenas / underscore

JavaScript's utility _ belt
https://underscorejs.org
MIT License
27.29k stars 5.53k forks source link

1.13.5 fails to install in a node.js docker container #2967

Closed RomanKisilenko closed 1 year ago

RomanKisilenko commented 1 year ago

npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! underscore@1.13.5 postinstall: patch-package npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the underscore@1.13.5 postinstall script.

Please revert the failed release or release a bugfix.

vincent-ogury commented 1 year ago

same issue here:

node_modules/underscore: Command failed.
Exit code: 127
Command: patch-package
Arguments:
Directory: node_modules/underscore
Output:
/bin/sh: patch-package: command not found
Nauzer commented 1 year ago

Same here on node v12.22.7

rubenesda commented 1 year ago

Same issue on node v11.14.0 Could this be fixed?

vincent-ogury commented 1 year ago

solve for now with:

  "resolutions": {
    "underscore": "1.13.4"
  },

in the package.json. It will force underscore to this version

barrenechea commented 1 year ago

@jgonggrijp a hand over here, please? It seems to be related to https://github.com/jashkenas/underscore/commit/08cb1404eb27b80bcadb87a32fcd515f23f7c9a6

leithouse commented 1 year ago

The issue is in the post install script in package.json https://github.com/jashkenas/underscore/blob/68e5eb68635548846b4663479b9d0fc78d090b0a/package.json#L95

nicolasKuhn-y commented 1 year ago

Same Issue

yannickcare commented 1 year ago

solve for now with:

  "resolutions": {
    "underscore": "1.13.4"
  },

in the package.json. It will force underscore to this version

I added this in my package.json, also the "scripts": { "preinstall": "npx npm-force-resolutions" },

but I still getting the issue underscore@1.13.5 postinstall: patch-package

Update: # npm WARN lifecycle c4g-api@0.0.1~preinstall: cannot run in wd c4g-api@0.0.1 npx force-resolutions (wd=/app)

yannickcare commented 1 year ago

Modified to include : DockerFile RUN npm i npm-force-resolutions RUN npm install --production --unsafe-perm

In package.json:

"scripts": { "preinstall": "npx force-resolutions" }, "resolutions": { "underscore": "1.13.4" },

which let me run the "resolutions" but in the end I still have underscore@1.13.5 postinstall /app/node_modules/underscore

update: added "underscore": "1.13.4" to my "dependencies" as well, now it works.

Keysox commented 1 year ago

Another workaround is yarn install --ignore-scripts

coughlinj commented 1 year ago

Workaround:

npm i patch-package

Before doing anything that requires underscore as a dependency.

SantiagoMejorada commented 1 year ago

Workaround:

npm i patch-package

Before doing anything that requires underscore as a dependency.

This save my build! Thanks a lot!

jgonggrijp commented 1 year ago

I just released 1.13.6, hopefully that fixes it. Please close if that is the case.

lucascmelo commented 1 year ago

thanks @jgonggrijp it's working now.