[email protected] postinstall: `lightercollective`

Created on 18 Jan 2019  路  23Comments  路  Source: webpack/webpack-cli

Describe the bug

Error on install.

What is the current behavior?

[email protected] postinstall: lightercollective

To Reproduce

  1. npm i -D webpack-cli

Expected behavior
Successful install

Screenshots
image

Additional context
Docker image: node:8.14.0

https://stackoverflow.com/q/54133942/340760

Bug High

Most helpful comment

Fixing on a new release this weekend

All 23 comments

Same issue

So this happens only when you try to install the package globally?

No, I'm installing with -D (--save-dev)

I'm having the same issue. It works fine globally, but not locally (as a dev dependency using npm 6.6.0).

Edit: I was installing with --no-bin-links.

We have the same issue here. Adding this dependency ourself helps for now, but this is not what we want.

I can't reproduce it with the commands provided (I didn't use Docker).
Are all of you using Docker? Please provide as much information as possible, triaging the issue is not simple. Or provide a repository where we can replicate the issue.

I solved it after being able to install it without --no-bin-links, so the problem was definitely the fact that there was no bin link created for lightercollective.

I used a docker image for building in jenkins, webpack-cli version 3.2.1 caused this issue

@ematipico I'm using yarn add --no-bin-links [email protected] and reproduced this issue. My yarn version is 1.1.3. Without --no-bin-links seems working fine. Also npm v5.6 seems working with npm install --no-bin-links [email protected]. I'm on Mac.

Can you guys provide more info on your system (or docker image)? I think it may be an issue with the symlinks. Mac/windows etc. handle this differently.

image

I have the same issue on Windows 10. I generate the packages.json file with gradle (kotlin-frontend). Adding lightercollective as a dependency or devDependency does not help.

Command to repro, on an empty folder (error only happens if there's a volume)

docker run -v "${pwd}:/usr/src/app" -w /usr/src/app --rm node:8.14.0 bash -c "npm init -y && npm install webpack-cli@latest postinstall lightercollective"

Output:

> [email protected] postinstall /usr/src/app/node_modules/webpack-cli
> lightercollective

fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EINVAL: invalid argument, open '/usr/src/app/node_modules/webpack-cli/package.json'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.Module._extensions..json (module.js:670:20)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/src/app/node_modules/webpack-cli/node_modules/lightercollective/index.js:5:15)
    at Module._compile (module.js:653:30)
npm WARN rollback Rolling back...
npm WARN rollback Rolling back...
npm WARN rollback Rolling back...
npm WARN rollback Rolling back...

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `lightercollective`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-01-22T12_10_25_574Z-debug.log

I didn't use docker. I am on Windows and I was able to reproduce the problem. I have created a sample package.json here.

Then remove the npm-cache entirely (by removing the folder %userprofile%\AppData\Roaming\npm-cache\).

After that run npm install --no-bin-links [email protected].

Node: 8.12.0
npm: 6.5.0

Hope this helps!

@tamasd temporary workaround is to specify an older version of webpack-cli manually in your dev dependencies :

kotlinFrontend {
    /* ... */

    npm {
        /* ... */
        devDependency("webpack-cli", "3.1.2") // cf https://github.com/webpack/webpack-cli/issues/738
    }

    /* ... */
}

@Bluexin thanks for the tip, I solved it temporarly by creating an "empty" (int main() { return 0; }) lightercollective.exe in my path.

I have this problem as well. I am using Ubuntu 18.04.1 LTS.

Installing the lightercollective dependency manually before webpack-cli didn't work.
Adding the lightercollective dependency to my package.json and executing npm install afterwards didn't work either.
I tried using both yarn and npm, I tried with and without the --no-bin-links and it would always give me an error.
Finally I tried changing the version of webpack-cli in the package.json file, I tried with every single 3.X version and none of them worked. Ultimately I tried with 2.1.5 and that version finally installed fine.

The error would always be this one:
image

I've been able to reproduce this using yarn.

In an empty directory the following works as expected:

yarn init -y
yarn add -D webpack webpack-cli

When adding

"installConfig": {
    "pnp": true
  }

To my package.json before trying to install webpack and webpack-cli then the install fails with the message in this thread.

This happens in yarn version v1.12.3. Upgrading to 1.13.0 fixed the issue.

Something may have changed inbetween those versions that is also failing in NPM.

I have the same issue on Windows 10. it happens with -D option.
so i just install lightercollective like npm i -D lightercollective
and then npm i -D webpack-cli Done. Successful install

also have this problem....

Fixing on a new release this weekend

Fixed

To whom it might concern, there are 3 ways to disabled lightercollective

  • don't include a collective entry in your package.json
  • set the rpm config level to silent, error, or warn
  • pass DISABLE_OPENCOLLECTIVE=1 upfront (1 or true or y or yes) or set it as ENV variable

I also find it weird nobody bothered me directly in here, and nobody filed a proper issue after digging what is exactly the problem.

lighter collective is few lines of code, it'd be great to improve it instead of removing it, 'cause it should be a drop-i alternative to opencollective and it should "_just work_".

Regards.

Or upgrade

Or upgrade

@evenstensberg if that was for me, yes, I've updated lightercollective to avoid undesired errors in unknown envs, instead of asking everyone using it to add || exit 0 in their package.json

Was this page helpful?
0 / 5 - 0 ratings

Related issues

evenstensberg picture evenstensberg  路  5Comments

billyjanitsch picture billyjanitsch  路  3Comments

jbottigliero picture jbottigliero  路  5Comments

RobotnickIsrael picture RobotnickIsrael  路  5Comments

snitin315 picture snitin315  路  5Comments