-
Notifications
You must be signed in to change notification settings - Fork 12k
Can not install angular-cli on Ubuntu 18.04 #14684
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
Comments
The relevant part of the log is: (node:5022) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/home/user/.angular-config.json'
at Object.openSync (fs.js:447:3)
at Object.writeFileSync (fs.js:1206:35)
at createGlobalSettings (/usr/lib/node_modules/@angular/cli/utilities/config.js:65:10)
at Object.getWorkspaceRaw (/usr/lib/node_modules/@angular/cli/utilities/config.js:73:26)
at setAnalyticsConfig (/usr/lib/node_modules/@angular/cli/models/analytics.js:288:43)
at Object.promptGlobalAnalytics (/usr/lib/node_modules/@angular/cli/models/analytics.js:326:9)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
(node:5022) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5022) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
+ @angular/cli@8.0.1 It seems that you don't have write permissions on that path. |
Thanks for the response! |
Because this logic is part of version 8. That said, we should probably handle it more gracefully and not bail out when the CLI doesn't have permission to write a global config. //cc @clydin, thoughts? |
It's worth mentioning that you should not install global npm modules with |
Thank you @filipesilva, I think I will check out npx. |
Instead of failing can we throw a warning and fallback to default config (analytics off). Alternatively, brew handles this really well by giving you a hint about what command you should run to fix your permissions. |
(node:18440) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/home/ashu/.angular-config.json'
|
Not being able to write to your own home directory typically signifies a system-wide configuration issue. Note, however, that the next patch release of the Angular CLI will not crash in this situation. |
then any alternate way to fix this issue as of now |
I am also facing the same issue. Any way to fix this? |
Well, I kinda hate npm tbh. However, I was installing my tools via it for a long time. That has changed. My solution is to use yarn: Works like a charm. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)I guess it affects "all" because I couldn't even install the cli.
Is this a regression?
It isntalls with 7.x version
Yes, the previous version in which this bug was not present was: ....Description
Using the angular cli installation command: sudo npm install -g @angular/cli
I get this error: https://pastebin.com/aqDXNBM0
There's no such file '/home/user/.angular-config.json', I have tried creating it by the 'touch' command, but it gave another error: https://pastebin.com/xZNQUwAa
I have tried 'npm cache clean --force' command with the same results.
I tried to install a previous verison of Angular with the 'sudo npm install -g @angular/[email protected]' and it installed it however it throws "Workspace needs to be loaded before it is used.", I guess it's because of the angular-config.json I've created...
A clear and concise description of the problem...🔬 Minimal Reproduction
sudo npm i -g @angular/cli
🔥 Exception or Error
I have linked the errors above.
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: