Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing analytics-prompt when running yarn install #16654

Closed
aldent95 opened this issue Jan 13, 2020 · 2 comments 路 Fixed by #16673
Closed

Missing analytics-prompt when running yarn install #16654

aldent95 opened this issue Jan 13, 2020 · 2 comments 路 Fixed by #16673

Comments

@aldent95
Copy link

@aldent95 aldent95 commented Jan 13, 2020

馃悶 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

@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Jan 14, 2020

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.

@aldent95

This comment has been minimized.

Copy link
Author

@aldent95 aldent95 commented Jan 14, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.