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

Cannot create "/usr/local/bin/ng" due to insufficient permissions. #16103

Closed
NatoBoram opened this issue Nov 7, 2019 · 2 comments

Comments

@NatoBoram
Copy link

@NatoBoram NatoBoram commented Nov 7, 2019

馃悶 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes

Description

ng update tries to modify my system without my consent and against my will, fails, then crashes.

馃敩 Minimal Reproduction

  1. ng update

馃敟 Exception or Error

The installed Angular CLI version is older than the latest published version.
Installing a temporary version to perform the update.
Installing packages for tooling via yarn.
error Cannot create "/usr/local/bin/ng" due to insufficient permissions.
An unhandled exception occurred: Package install failed, see above.
See "/tmp/ng-8M0LvS/angular-errors.log" for further details.

馃實 Your Environment

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / 鈻 \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.13
Node: 13.1.0
OS: linux x64
Angular: 8.2.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.13
@angular-devkit/build-angular     0.803.13
@angular-devkit/build-optimizer   0.803.13
@angular-devkit/build-webpack     0.803.13
@angular-devkit/core              8.3.13
@angular-devkit/schematics        8.3.13
@angular/cdk                      8.2.3
@angular/cli                      8.3.13
@angular/flex-layout              8.0.0-beta.27
@angular/material                 8.2.3
@ngtools/webpack                  8.3.13
@schematics/angular               8.3.13
@schematics/update                0.803.13
rxjs                              6.5.3
typescript                        3.5.3
webpack                           4.39.2

Anything else relevant?

I just want to point out that it is extremely bad etiquette to make undesired modifications to people's system.

gendnat@gcmi-p109 
----------------- 
OS: Ubuntu 19.10 x86_64 
Host: 3306A4F ThinkCentre M82 
Kernel: 5.0.0-32-generic 
Uptime: 3 hours, 26 mins 
Packages: 2300 (dpkg), 39 (snap) 
Shell: bash 5.0.3 
Resolution: 1680x1050, 1920x1080 
DE: GNOME 3.34.1 
WM: GNOME Shell 
WM Theme: Adwaita 
Theme: Adwaita-dark [GTK2/3] 
Icons: Yaru [GTK2/3] 
Terminal: gnome-terminal 
CPU: Intel i5-3470 (4) @ 3.600GHz 
GPU: Intel HD Graphics 
Memory: 12869MiB / 15829MiB 

Duplicate of #16010

@NatoBoram

This comment has been minimized.

Copy link
Author

@NatoBoram NatoBoram commented Nov 7, 2019

To get around this bug, after every single sudo ng update commands ran, you need to run this.

sudo yarn global add @angular/cli@latest
sudo chown $USER:$USER $HOME -Rc
ng config -g cli.warnings.versionMismatch false
@alan-agius4

This comment has been minimized.

Copy link
Collaborator

@alan-agius4 alan-agius4 commented Nov 7, 2019

This should be fixed in the next release via #16011. As now we now longer create binary links.

Note: before running ng update run npm i @angular/cli@latest 鈥攏o-save as otherwise the old version of the cli bootstrapping will be used which will cause the permission errors.

@alan-agius4 alan-agius4 closed this Nov 7, 2019
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.