x or write it if not found the right command)
[sudo] npm i -g @angular/cli
I can install the latest version (7.3.9)
When try install the last version of angular-cli npm package the command output a error and the installation process exited with status 130.
I tried install with and without sudo privileges.
Run this command: npm i -g @angular/cli
The npm output when run the install command:
[ ..........] \ extract:genfun: sill extract [email protected]
/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng
> @angular/[email protected] postinstall /usr/local/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js
? Would you like to share anonymous usage data with the Angular Team at Google under
Googleβs Privacy Policy at https://policies.google.com/privacy? For more details and
npm ERR! code ELIFECYCLE
npm ERR! errno 130
npm ERR! @angular/[email protected] postinstall: `node ./bin/postinstall/script.js`
npm ERR! Exit status 130
npm ERR!
npm ERR! Failed at the @angular/[email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/aran/.npm/_logs/2019-05-30T12_29_27_291Z-debug.log
And the log that npm create with the error (I've create a github gist because the file is too long):
Gist Log
NPM version: 6.4.1
OS: Ubuntu 18.04
Anything else relevant?
...?
In case it helps I tried to update Nodejs (v12.3.1) and NPM (v6.9.0) and the problem not solve.
Hey! I finded a fast solution for solve this problem. I one of my attempts to know what happens, I see that if create a new user in the same os environment, the problem nothing happens.
My solution is remove all user data related with npm and angular cli, like .angular-config.json user file, .npm folder, .cache folder and others (I don't remember all files that I removed :cry:)
That is possible it angular save any state or any others files in user folder? Or that it npm save any state or other think?
Thank's!
I am having the same exact issue. Tried deleting .angular-config.json, .npm and .cache folders, but it's still not working.
npm -v
6.9.0
node -v
v10.16.0
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
sudo npm -g install @angular/[email protected]
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng
> @angular/[email protected] postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js
? Would you like to share anonymous usage data with the Angular Team at Google under
Googleβs Privacy Policy at https://policies.google.com/privacy? For more details and
how to change this setting, see http://angular.io/analytics. No
(node:7863) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/home/abcde/.angular-config.json'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194: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 process._tickCallback (internal/process/next_tick.js:68:7)
(node:7863) 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:7863) [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/[email protected]
updated 1 package in 7.565s
@amoncusir could you check your command history and see what else you deleted? Thanks!
[~]# which npm
/bin/npm
[~]# npm -v
6.9.0
[~]# which node
/bin/node
[~]# node -v
v10.16.0
[~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
[~]# npm list -g --depth=1
/usr/lib
βββ¬ @angular/[email protected]
β βββ @angular-devkit/[email protected]
β βββ @angular-devkit/[email protected]
β βββ @angular-devkit/[email protected]
β βββ @schematics/[email protected]
β βββ @schematics/[email protected]
β βββ @yarnpkg/[email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
β βββ [email protected]
βββ¬ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ lodash.[email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
[~]npm install -g @angular/cli
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng
> @angular/[email protected] postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js
? Would you like to share anonymous usage data with the Angular Team at Google under
Googleβs Privacy Policy at https://policies.google.com/privacy? For more details and
how to change this setting, see http://angular.io/analytics. No
(node:7812) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/root/.angular-config.json'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194: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 process._tickCallback (internal/process/next_tick.js:68:7)
(node:7812) 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:7812) [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/[email protected]
added 227 packages from 175 contributors in 36.211s
When installed node and npm with snap I had to run the following command in order to install @angular/cli globally:
sudo npm install -g @angular/cli --scripts-prepend-node-path
same here , all build using ng-cli were broken,
(the build do a local temporary install of node & ng-cli )
added the following in the build scripts and the issue was solved
npm config set script-prepend-node-path true
Nothing mentioned worked for me, additionally, everything I have found says not to install as root, or using sudo.
I followed some official documentation from npm manual and it worked for me.
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
I just ran into the same issue. Using yarn appears to work just fine until they fix this:
yarn add global @angular/cli
Run npm install -g @angular/cli without sudo. It worked for me.
Not sure if this helps, none of above mentioned worked for me.
Still getting
? Would you like to share anonymous usage data with the Angular Team at Google under
Googleβs Privacy Policy at https://policies.google.com/privacy? For more details and
npm ERR! code ELIFECYCLE
npm ERR! errno 130
npm ERR! @angular/[email protected] postinstall: `node ./bin/postinstall/script.js`
npm ERR! Exit status 130
And if I tried with
yarn add global @angular/cli
Following error occurs
2019/06/14 13:54:54 [~]$ yarn add global @angular/cli
yarn add v1.16.0
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/ubuntu/node_modules/@angular/cli: Command failed.
Exit code: 1
Command: node ./bin/postinstall/script.js
Arguments:
Directory: /home/ubuntu/node_modules/@angular/cli
Output:
/home/ubuntu/node_modules/rxjs/internal/util/hostReportError.js:4
setTimeout(function () { throw err; });
^
UnexpectedEndOfInputException [Error]: Unexpected end of file.
at _readValue (/home/ubuntu/node_modules/@angular-devkit/core/src/json/parser.js:624:19)
at parseJsonAst (/home/ubuntu/node_modules/@angular-devkit/core/src/json/parser.js:721:17)
at Object.parseJson (/home/ubuntu/node_modules/@angular-devkit/core/src/json/parser.js:753:16)
at MapSubscriber.project (/home/ubuntu/node_modules/@angular-devkit/core/src/experimental/workspace/workspace.js:259:175)
at MapSubscriber._next (/home/ubuntu/node_modules/rxjs/internal/operators/map.js:49:35)
at MapSubscriber.Subscriber.next (/home/ubuntu/node_modules/rxjs/internal/Subscriber.js:66:18)
at MapSubscriber._next (/home/ubuntu/node_modules/rxjs/internal/operators/map.js:55:26)
at MapSubscriber.Subscriber.next (/home/ubuntu/node_modules/rxjs/internal/Subscriber.js:66:18)
at Observable._subscribe (/home/ubuntu/node_modules/@angular-devkit/core/node/host.js:191:21)
at Observable._trySubscribe (/home/ubuntu/node_modules/rxjs/internal/Observable.js:44:25)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
My problem was the following:
npm install -g @angular/cli
npm ERR! path /Users/acme/.npm/_cacache/index-v5/48/99
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/Users/acme/.npm/_cacache/index-v5/48/99'
As it turned out, user 'acme' was given no permissions to folder '48'. Assigning 'everyone' 'Read & Write' permissions to folder 'index-v5' fixed the problem for now.
I got the same problem but I solved mine by running CMD as adminsitrator.
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._
Most helpful comment
When installed
nodeandnpmwithsnapI had to run the following command in order to install @angular/cli globally:sudo npm install -g @angular/cli --scripts-prepend-node-path