GithubHelp home page GithubHelp logo

Comments (3)

Artur- avatar Artur- commented on July 30, 2024

npm run disable should rename vaadin-usage-statistics.js to vaadin-usage-statistics.js.bak and then vaadin-usage-statistics-optout.js to vaadin-usage-statistics.js. Sounds like thins goes wrong somehow. Check what is in node_modules/@vaadin/vaadin-usage-statistics after running npm run disable

from vaadin-usage-statistics.

ankon avatar ankon commented on July 30, 2024

Having the same issue, and did a bit of digging. Basically what seems to happen is this, assuming that node_modules doesn't exist in the beginning, and .npmrc contains settings for opting out.

  1. @vaadin/vaadin-usage-statistics is installed, and runs postinstall (check.js)
  2. check.js finds that collection is disabled, and renames vaadin-usage-statistics.js to vaadin-usage-statistics.js.bak, and then vaadin-usage-statistics-optout.js to vaadin-usage-statistics.js
  3. "something" happens that runs @vaadin/vaadin-usage-statistics postinstall (check.js) again
  4. check.js finds that collection is disabled, and renames vaadin-usage-statistics.js to vaadin-usage-statistics.js.bak ... and then fails to rename vaadin-usage-statistics-optout.js, because it doesn't exist anymore since step 2.

At this point the only thing you can do is remove node_modules/@vaadin/vaadin-usage-statistics and run npm install again.

IMHO this is a bug in @vaadin/vaadin-usage-statistics, it shouldn't rename the source files, but rather have a version for optin and optout, and copy the correct one onto the bare name.

For reproduction I tried this:

$ rm -rf node_modules/@vaadin/vaadin-usage-statistics/
$ npm install

> @vaadin/[email protected] postinstall /home/travis/build/.../node_modules/@vaadin/vaadin-usage-statistics
> node check.js


    You have disabled Vaadin development time usage statistics collection. To re-enable, run:
    npm explore @vaadin/vaadin-usage-statistics -- npm run enable
    For more details, see https://github.com/vaadin/vaadin-usage-statistics
  
added 1 package from 1 contributor in 9.347s
$ npm install
up to date in 8.557s
$ npm explore @vaadin/vaadin-usage-statistics -- npm run postinstall                                                

> @vaadin/[email protected] postinstall /home/travis/build/.../node_modules/@vaadin/vaadin-usage-statistics
> node check.js


    You have disabled Vaadin development time usage statistics collection. To re-enable, run:
    npm explore @vaadin/vaadin-usage-statistics -- npm run enable
    For more details, see https://github.com/vaadin/vaadin-usage-statistics
  
File not found!
$ ls /home/travis/build/Collaborne/collaborne-polaris-app/node_modules/@vaadin/vaadin-usage-statistics
check.js  LICENSE  package.json  README.md  vaadin-usage-statistics.js.bak

from vaadin-usage-statistics.

ankon avatar ankon commented on July 30, 2024

Looked further through our build logs, and found the "something": We run npm rebuild --update-binary whenever the NodeJS version changes to force updates to certain dependencies with native libraries, and that one does trigger a postinstall for everything.

from vaadin-usage-statistics.

Related Issues (13)

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.