Error code 1 when installing Angular CLI
See original GitHub issueThis is a bug report.
When trying to install Angular CLI, Iβm getting the errors listed below.
This did not happen about 3 weeks ago when I first installed it, but it does now.
OS
OSX El Capitan
Versions
Node v5.2.0 NPM 3.3.12
How I found the error
I simply ran npm i -g --save angular-cli
. There were errors about lodash
being expired (because a half billion modules use an outdated lodash.) and a reference to padleft that you can see at the top of the log below. For all I know that version of lodash used the leftpad
module that caused all the ruckus recently. Thatβs just a guess, but itβs breaking the build.
Error
install:lodash.padlef β β’βββββββββββ
postinstall:lodash._baset β β’βββββββββ
postinstall:npmlog β β’ββββββββββ
postinstall:mime-db β lif β β’βββββββββ
postinstall:validate-npm- β β’βββββββββ
> broccoli@1.0.0-beta.6 postinstall /usr/local/lib/node_modules/angular-cli/node_modules/broccoli
> multidep test/multidep.json
postinstall:underscore.st β β’βββββββββ
broccoli-plugin 1.0.0: Installing
module.js:329
throw err;
^
Error: Cannot find module 'config-chain'
at Function.Module._resolveFilename (module.js:327:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/node_modules/npm/lib/config/core.js:2:10)
at Module._compile (module.js:399:26)
at Object.Module._extensions..js (module.js:406:10)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:355:17)
Error: npm exited with exit code 1, signal null
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/angular-cli/node_modules/multidep/index.js:90:28)
at emitTwo (events.js:88:13)
at ChildProcess.emit (events.js:173:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
postinstall:underscore.st β β’ββββββββββββββββ
npm WARN install:broccoli@1.0.0-beta.6 broccoli@1.0.0-beta.6 postinstall: `multidep test/multidep.json`
npm WARN install:broccoli@1.0.0-beta.6 Exit status 1
postinstall β β’βββββββββββββ
executeActions β rollback β β’βββββββββββββββββββ
executeActions β rollback β β’βββββββββββββββββββ
runTopLevelLifecycles β β’βββββββββββββββββββ
/usr/local/lib
βββ (empty)
runTopLevelLifecycles β β’ββββββββββββββββ
npm ERR! code 1
Issue Analytics
- State:
- Created 7 years ago
- Comments:38 (12 by maintainers)
Top Results From Across the Web
Error code 1 when installing Angular CLI #345 - GitHub
Guys, I uninstalled angular-cli as I had originally installed it globally with sudo. Then, I made sure that the owner permissions were reset...
Read more >How to solve npm install error βnpm ERR! code 1β
If your Node.js version is very recent, try downgrading. The stable version 14.16.1 worked.
Read more >CLI Overview and Command Reference - Angular
The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a commandΒ ......
Read more >How to solve npm ERR! code 1 when running npm install
Fix npm error code 1 by updating your dependencies Β· Update one package version in package.json file Β· Then run npm install Β·...
Read more >ng: command not found (Angular) error [Solved] | bobbyhadz
To solve the error "ng: command not found", install the angular cli package globally by running npm install -g @angular/cli@latest and restart your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@pinalbhatt @tedpark I encountered the same problem. I found the solution on the official website (EACCES error): https://docs.npmjs.com/getting-started/fixing-npm-permissions
you should not install it as ROOT user