← 输入框|github.com|刷新
Skip to content

Missing analytics-prompt when running yarn install #16654

Closed

Description

@aldent95

🐞 Bug report

Is this a regression?

Yes, the previous version in which this bug was not present was: 7.2.14

Description

When we try and run yarn install through our CI pipeline, we get an error saying that the module ./analytics-prompt cannot be found.

I've tried the following, which is all I can think of, to solve the issue:

  • Disable the analytics for the project in the angular.json file
  • Disable the analytics for the server using the environment variable
  • Disable the analytics for the user by running ng analytics off for the CI user
  • Removed the --no-interaction option from our yarn command

None of the above fixed the issue.
The weird thing is, the install works fine for my user account on the same server, same directory, exact same command. It also works fine on my local machine.

I've done all I can think of so hopefully someone here has some ideas.

🔬 Minimal Reproduction

Full install command that causes the issue:
yarn install --ignore-optional --prod --frozen-lockfile

Beyond that I can't really provide any other reproduction steps as I can't reproduce it outside of our pipeline.

🔥 Exception or Error


C:\Temp\ProjectName\feature\Angular_Update\A@2>yarn install --ignore-optional --prod --frozen-lockfile 
yarn install v1.9.2
warning package.json: No license field
warning project-name@0.0.1: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.2: The platform "win32" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @angular/core@8.2.14" has unmet peer dependency "zone.js@~0.9.1".
warning " > @angular/flex-layout@7.0.0-beta.24" has incorrect peer dependency "@angular/cdk@^7.0.0-rc.0".
warning " > ng-packagr@5.7.1" has unmet peer dependency "tslib@^1.9.0".
warning " > codelyzer@5.2.1" has unmet peer dependency "tslint@^5.0.0".
[4/4] Building fresh packages...
error C:\Temp\ProjectName\feature\Angular_Update\A@2\node_modules\@angular\cli: Command failed.
Exit code: 1
Command: node ./bin/postinstall/script.js
Arguments: 
Directory: C:\Temp\ProjectName\feature\Angular_Update\A@2\node_modules\@angular\cli
Output:
internal/modules/cjs/loader.js:796
    throw err;
    ^
Error: Cannot find module './analytics-prompt'
Require stack:
- C:\Temp\ProjectName\feature\Angular_Update\A@2\node_modules\@angular\cli\bin\postinstall\script.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (C:\Temp\ProjectName\feature\Angular_Update\A@2\node_modules\@angular\cli\bin\postinstall\script.js:5:1)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
'C:\\Temp\\ProjectName\\feature\\Angular_Update\\A@2\\node_modules\\@angular\\cli\\bin\\postinstall\\script.js'
  ]
}
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
script returned exit code 1

🌍 Your Environment


Angular CLI: 8.3.22
Node 12.14.1
OS: win32 x64
Angular:
...
Package                                                             Version
-------------------------------------------------------------------------------
@angular-devkit/architect                                           0.803.22
@angular-devkit/core                                                8.3.22
@angular-devkit/schematics                                          8.3.22
@schematics/angular                                                 8.3.22
@schematics/update                                                  0.803.22
rxjs                                                                6.4.0

Anything else relevant?
OS: Windows Server 2016
Package Manager: yarn 1.9.2

Pipeline is being run by Jenkins

Activity

  1. clydin commented on Jan 14, 2020

    @clydin
    Member

    Is there a way to check if the file in question (analytics-prompt.js) is actually there? It should be right next to C:\Temp\ProjectName\feature\Angular_Update\A@2\node_modules\@angular\cli\bin\postinstall\script.js in that example.

    Either way, that script can be made to be more fail-safe in the event this happens.

  2. added
    freq1: low
    on Jan 14, 2020
  3. modified the milestone: Backlog on Jan 14, 2020
  4. aldent95 commented on Jan 14, 2020

    @aldent95
    Author

    @clydin The file exists if I run the command under my user account, but not when the command is run from Jenkins.

    It's been the same all the way through the steps I listed above to try and fix it.

  5. aldent95 commented on Jan 23, 2020

    @aldent95
    Author

    Installed v9.0.0-rc.10 today and can confirm it's working fine now. Thanks for speedy fix team :D

  6. angular-automatic-lock-bot commented on Feb 23, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Feb 23, 2020
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

    area: @angular/clifreq1: lowseverity3: brokentype: bug/fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions