Skip to content

[BUG] Postinstall does not output anything from script (even with loglevel=silly) #3347

Description

@hasezoey

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When installing a package with a postinstall script to output to console if the script logs something (thanks to other issues i already know that it was intentional to make it "quieter", but even with --loglevel silly it did not output anything)

PS: when the script errors, the output is logged, but if it does not error out it is not logged (with loglevel silly)

NPM Output
$ npm i --loglevel silly
npm verb cli [
npm verb cli   '/usr/bin/node',
npm verb cli   '/home/hasezoey/.npm-packages/bin/npm',
npm verb cli   'i',
npm verb cli   '--loglevel',
npm verb cli   'silly'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/home/hasezoey/.npm-packages/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/home/hasezoey/Downloads/npm-postinstall/root-package/.npmrc Completed in 1ms
npm timing config:load:project Completed in 1ms
npm timing config:load:file:/home/hasezoey/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/home/hasezoey/.npm-packages/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:credentials Completed in 0ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 7ms
npm timing npm:load:configload Completed in 7ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 1ms
npm timing npm:load:cleanupLog Completed in 1ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 0ms
npm timing npm:load Completed in 12ms
npm timing config:load:flatten Completed in 1ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 7ms
npm timing idealTree:userRequests Completed in 0ms
npm sill idealTree buildDeps
npm timing idealTree:#root Completed in 1ms
npm timing idealTree:buildDeps Completed in 1ms
npm timing idealTree:fixDepFlags Completed in 0ms
npm timing idealTree Completed in 8ms
npm timing reify:loadTrees Completed in 8ms
npm timing reify:diffTrees Completed in 0ms
npm sill reify moves {}
npm timing reify:retireShallow Completed in 1ms
npm timing reify:createSparse Completed in 0ms
npm timing reify:loadBundles Completed in 0ms
npm sill audit bulk request { postinstall_package: [ '1.0.0' ] }
npm timing reifyNode:node_modules/postinstall-package Completed in 18ms
npm timing reify:unpack Completed in 18ms
npm timing reify:unretire Completed in 0ms
npm timing build:queue Completed in 0ms
npm timing build:deps Completed in 1ms
npm timing build:queue Completed in 0ms
npm info run [email protected] postinstall ../postinstall-package node ./postinstall.js
npm info run [email protected] postinstall { code: 0, signal: null }
npm timing build:run:postinstall:../postinstall-package Completed in 25ms
npm timing build:run:postinstall Completed in 26ms
npm timing build:links Completed in 26ms
npm timing build Completed in 27ms
npm timing reify:build Completed in 27ms
npm timing reify:trash Completed in 0ms
npm timing reify:save Completed in 2ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 490ms
npm timing auditReport:getReport Completed in 492ms
npm sill audit report {}
npm timing auditReport:init Completed in 0ms
npm timing reify:audit Completed in 494ms
npm timing reify Completed in 510ms
npm sill ADD node_modules/postinstall-package

added 1 package, and audited 3 packages in 656ms

found 0 vulnerabilities
npm timing command:install Completed in 521ms
npm verb exit 0
npm timing npm Completed in 660ms
npm info ok

global npmrc:

prefix=/home/hasezoey/.npm-packages
sign-git-tag=true

Expected Behavior

The log from the script to be logged somehow to the console (even if it requires an different loglevel)

Steps To Reproduce

  1. git clone https://github.com/hasezoey/npm-postinstall
  2. cd npm-postinstall
  3. cd root-package
  4. npm install / npm install --loglevel silly

Environment

  • OS: Linux (Mint 20.1)
  • Node: 16.2.0
  • npm: 7.15.1 (also tested with 7.2.x)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions