angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Error code 1 when installing Angular CLI

Open cwramsey opened this issue 10 years ago • 38 comments

This 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- ▌ ╢█████████
> [email protected] 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:[email protected] [email protected] postinstall: `multidep test/multidep.json`
npm WARN install:[email protected] Exit status 1
postinstall               ▄ ╢█████████████
executeActions → rollback ▄ ╢███████████████████
executeActions → rollback ▌ ╢███████████████████
runTopLevelLifecycles     ▌ ╢███████████████████
/usr/local/lib
└── (empty)

runTopLevelLifecycles     ▌ ╢████████████████
npm ERR! code 1

cwramsey avatar Mar 24 '16 20:03 cwramsey

I'm having a similar issue which looks to be occurring around the same point "[email protected] postinstall".

OSX El Capitan Node v5.7.0 NPM 3.8.2

scatcher avatar Mar 24 '16 21:03 scatcher

Thats interesting, I don't have that issue on similar versions than you. Can you just try to re-run install again or if it's possible provide more info about reproducing this. Thanks.

jkuri avatar Mar 24 '16 23:03 jkuri

Me too getting error with "[email protected] " [Issue seems to be only with v0.0.27, 0.0.26 is installing fine. ]

`npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0. npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0. npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. /usr/local/bin/ng -> /usr/local/lib/node_modules/angular-cli/bin/ng

[email protected] postinstall /usr/local/lib/node_modules/angular-cli/node_modules/broccoli multidep test/multidep.json

broccoli-plugin 1.0.0: Installing npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/.bin/npm" "install" "[email protected]" npm ERR! node v4.4.1 npm ERR! npm v2.14.10 npm ERR! path /Users/user1/.npm/broccoli-plugin/1.0.0/package/package.json.40f3f354e3332ce831a21d4907afdfd3 npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open '/Users/user1/.npm/broccoli-plugin/1.0.0/package/package.json.40f3f354e3332ce831a21d4907afdfd3' npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, open '/Users/user1/.npm/broccoli-plugin/1.0.0/package/package.json.40f3f354e3332ce831a21d4907afdfd3'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'open', npm ERR! path: '/Users/user1/.npm/broccoli-plugin/1.0.0/package/package.json.40f3f354e3332ce831a21d4907afdfd3' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! /usr/local/lib/node_modules/angular-cli/node_modules/broccoli/test/multidep/broccoli-plugin-1.0.0/npm-debug.log Error: npm exited with exit code 243, signal null at ChildProcess. (/usr/local/lib/node_modules/angular-cli/node_modules/multidep/index.js:90:28) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) /usr/local/lib └── (empty)

npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli" npm ERR! node v4.4.1 npm ERR! npm v3.8.3 npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: multidep test/multidep.json npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script 'multidep test/multidep.json'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the broccoli package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! multidep test/multidep.json npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs broccoli npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls broccoli npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/user1/npm-debug.log npm ERR! code 1`

pinalbhatt avatar Mar 25 '16 01:03 pinalbhatt

Hm... I tried it myself and had some trouble. Then I did npm cache clean and it seemed to be ok. Can I ask you to try doing that as well?

filipesilva avatar Mar 25 '16 01:03 filipesilva

@filipesilva tried after cleaning cache but no success.

pinalbhatt avatar Mar 25 '16 02:03 pinalbhatt

@filipesilva Cleaning cache didn't help here either. While trying to debug I also noticed that if I simply run "npm install -g [email protected]" I received the same error which seems to point at broccoli as the issue.

scatcher avatar Mar 25 '16 02:03 scatcher

Huh.... really odd. I wonder how I could get a working version of brocolli but not not you guys....

filipesilva avatar Mar 25 '16 02:03 filipesilva

haha... thats what is alfa release.... since last couple of days i am trying to make angular-cli and angularfire2 work. But finally decided to configure angularfire2 manually.

pinalbhatt avatar Mar 25 '16 02:03 pinalbhatt

[email protected] works for me.

OSX 10.11.4 NPM 3.7.3 Node v5.9.1

❯ ng -v
angular-cli: 0.0.27
node: 5.9.1
os: darwin x64

wolfie82 avatar Mar 25 '16 06:03 wolfie82

Me too getting error with "[email protected] " [email protected] not working. but 0.0.26 is fine.

ted@TedMac ~> npm install -g angular-cli npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0. npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0. npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. /usr/local/bin/ng -> /usr/local/lib/node_modules/angular-cli/bin/ng

[email protected] postinstall /usr/local/lib/node_modules/angular-cli/node_modules/broccoli multidep test/multidep.json

broccoli-plugin 1.0.0: Installing npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/Cellar/node/5.9.1/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/.bin/npm" "install" "[email protected]" npm ERR! node v5.9.1 npm ERR! npm v2.14.10 npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants eslint@^2.2.0

npm ERR! Please include the following file with any support request: npm ERR! /usr/local/lib/node_modules/angular-cli/node_modules/broccoli/test/multidep/broccoli-plugin-1.0.0/npm-debug.log Error: npm exited with exit code 1, signal null at ChildProcess. (/usr/local/lib/node_modules/angular-cli/node_modules/multidep/index.js:90:28) at emitTwo (events.js:100:13) at ChildProcess.emit (events.js:185:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12) /usr/local/lib └── (empty)

npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/Cellar/node/5.9.1/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli" npm ERR! node v5.9.1 npm ERR! npm v3.7.3 npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: multidep test/multidep.json npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script 'multidep test/multidep.json'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the broccoli package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! multidep test/multidep.json npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs broccoli npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls broccoli npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/ted/npm-debug.log npm ERR! code 1

tedpark avatar Mar 25 '16 09:03 tedpark

Works like charm!

npm install eslint -g npm install jslint -g

angular-cli: 0.0.27 node: 5.9.1 os: darwin x64

tedpark avatar Mar 25 '16 11:03 tedpark

@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

anode7 avatar Mar 25 '16 13:03 anode7

@filipesilva running npm cache clean fixed the problem. It installed 0.0.27 without any trouble. Perhaps broccoli has updated whatever was causing the bug.

cwramsey avatar Mar 25 '16 14:03 cwramsey

Running npm cache clean didn't resolve for me but fixing npm permissions per recommendation from @anode7 did resolve the problem.

scatcher avatar Mar 25 '16 15:03 scatcher

@scatcher Now you can download a package globally without using sudo and (EACCESS) error free

anode7 avatar Mar 25 '16 15:03 anode7

@anode7 good catch! I should have remembered that OSX sometimes has those sudo issues.

Is anyone still having issues with install?

filipesilva avatar Mar 25 '16 15:03 filipesilva

@filipesilva also on Ubuntu (the path prefix to npm's directory is just /usr)

After this fix , be sure not to use "sudo" to install a -g package , also for an update of npm : npm install npm -g

anode7 avatar Mar 25 '16 16:03 anode7

Good tips!

I'm closing the issue but if someone has the same problem again, I'll reopen.

filipesilva avatar Mar 25 '16 16:03 filipesilva

I'm having the same problem... I'm running that thing in docker and it fails :(

Here is an extract of my docker file:

`FROM node:latest

USER root RUN npm install -g protractor RUN npm install -g angular-cli`

Here is the output:

`> [email protected] postinstall /usr/local/lib/node_modules/angular-cli/node_modules/broccoli

multidep test/multidep.json

broccoli-plugin 1.0.0: Installing npm info it worked if it ends with ok npm info using [email protected] npm info using [email protected] npm info attempt registry request try #1 at 2:22:41 PM npm http request GET https://registry.npmjs.org/broccoli-plugin npm http 200 https://registry.npmjs.org/broccoli-plugin npm info retry fetch attempt 1 at 2:22:42 PM npm info attempt registry request try #1 at 2:22:42 PM npm http fetch GET https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.0.0.tgz npm http fetch 200 https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.0.0.tgz npm ERR! Linux 4.1.19-boot2docker npm ERR! argv "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/.bin/npm" "install" "broccoli- [email protected]" npm ERR! node v5.10.0 npm ERR! npm v2.14.21 npm ERR! path /root/.npm/broccoli-plugin/1.0.0/package npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/root/.npm/broccoli-plugin/1.0.0/package' npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, mkdir '/root/.npm/broccoli-plugin/1.0.0/package'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'mkdir', npm ERR! path: '/root/.npm/broccoli-plugin/1.0.0/package' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! /usr/local/lib/node_modules/angular-cli/node_modules/broccoli/test/multidep/broccoli-plugin-1.0.0/npm-debug .log Error: npm exited with exit code 243, signal null at ChildProcess. (/usr/local/lib/node_modules/angular-cli/node_modules/multidep/index.js:90:28) at emitTwo (events.js:100:13) at ChildProcess.emit (events.js:185:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12) npm info lifecycle [email protected]~postinstall: Failed to exec postinstall script /usr/local/lib `-- (empty)

npm ERR! Linux 4.1.19-boot2docker npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli" npm ERR! node v5.10.0 npm ERR! npm v3.8.3 npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: multidep test/multidep.json npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script 'multidep test/multidep.json'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the broccoli package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! multidep test/multidep.json npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs broccoli npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls broccoli npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /root/npm-debug.log npm ERR! code 1 #`

I tried the fix with the user rights, but it still fails.

oYo-fr avatar Apr 05 '16 14:04 oYo-fr

I'm having the same problem...

I'm running that thing in docker and it fails :(

Here is an extract of my docker file:

`FROM node:latest

USER root

you should not install it as ROOT user

anode7 avatar Apr 05 '16 16:04 anode7