Skip to content

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

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 15 tasks
NatoBoram opened this issue Nov 7, 2019 · 3 comments
Closed
1 of 15 tasks

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

NatoBoram opened this issue Nov 7, 2019 · 3 comments

Comments

@NatoBoram
Copy link

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
Copy link
Author

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
Copy link
Collaborator

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 —no-save as otherwise the old version of the cli bootstrapping will be used which will cause the permission errors.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants