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

Cannot install via npm

Open KlausEichinger opened this issue 9 years ago • 29 comments

MacOS Sierra, [email protected], [email protected]

I posted this issue also at npm …

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'install', 1 verbose cli '-g', 1 verbose cli 'angular-cli' ] 2 info using [email protected] 3 info using [email protected] 4 verbose stack Error: Cannot find module 'github-url-from-git' 4 verbose stack at Function.Module._resolveFilename (module.js:470:15) 4 verbose stack at Function.Module._load (module.js:418:25) 4 verbose stack at Module.require (module.js:498:17) 4 verbose stack at require (internal/module.js:20:19) 4 verbose stack at Object. (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:2:22) 4 verbose stack at Module._compile (module.js:571:32) 4 verbose stack at Object.Module._extensions..js (module.js:580:10) 4 verbose stack at Module.load (module.js:488:32) 4 verbose stack at tryModuleLoad (module.js:447:12) 4 verbose stack at Function.Module._load (module.js:439:3) 5 verbose cwd /Users/klaus 6 error Darwin 16.4.0 7 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli" 8 error node v7.4.0 9 error npm v4.0.5 10 error code MODULE_NOT_FOUND 11 error Cannot find module 'github-url-from-git' 12 error If you need help, you may report this error at: 12 error https://github.com/npm/npm/issues 13 verbose exit [ 1, true ]

KlausEichinger avatar Jan 29 '17 12:01 KlausEichinger

@KlausEichinger I am afraid this is not enough context to be able to assist you.

What exactly are you trying to do ? Where did you start off, which commands did you perform up-to the error provided ?

catull avatar Jan 29 '17 14:01 catull

Hi. Can you please provide the command line? Also, have you tried to add sudo at the beginning of your command line? Please let us know. Cheers...!

AlexTCarneiro avatar Jan 29 '17 15:01 AlexTCarneiro

I'd also suggest updating npm.

clydin avatar Jan 29 '17 16:01 clydin

Thank you for you interest. I tried to install a new angular project via angular-cli. In Terminal I called 'sudo npm install -g angular-cli'. Like it is recommended on cli.angular.io. This attempt failed several times with error message as written above.

My MacOS, Node and npm are up to date as you can see above.

KlausEichinger avatar Jan 29 '17 18:01 KlausEichinger

@KlausEichinger

Lieber Klaus

Du musst schon mehr herausrücken. Mit dem Wenigen, dass Du preisgibst, können wir Dir nicht wirklich helfen.

Du kannst mal damit anfangen, dass Du genau angibst, was Du genau wo eintippst. Sonst sind wir nur noch am Raten und Mutmassen, was echt niemanden weiterbringt. Weniger vage beschreiben und mal konkret Dinge beim Namen nennen.

Wie hast Du z.B. nodeJS installiert, das fehlt komplett.

Also, der Ball ist bei Dir.

Ich verwende i.Ü. ebenfalls macOS Sierra 10.12.2, nodeJS 7.4.0 und npm 4.1.2. Habe vor wenigen Stunden npm von 4.0.5 auf 4.1.2 aufgefrischt, ohne Fehler.

catull avatar Jan 29 '17 19:01 catull

If you search for the error "Cannot find module 'github-url-from-git'", there are plenty of hits, such as https://github.com/nodejs/node/issues/3540.

Most of the hits suggest to get rid of your node installation, and re-install nodeJS.

Is that an option for you ? Your installation seems to be broken. I have installed nodeJS for a long time, every 2 to 3 months. Never had to de-install a version, never had to delete the folder /usr/local/lib/node_modules/.

catull avatar Jan 29 '17 19:01 catull

Hallo lieber @catull,

ich arbeite nicht erst seit heute früh als Entwickler. Was verstehst nicht du nicht daran, dass ich ein Angular(2) Projekt aufsetzen möchte? Dazu möchte ich angular-cli nutzen. Mit Node und npm arbeite ich auch schon etwas länger ;)

Wie du aus dem von npm erzeugten und oben zitierten Protokll ersehen kannst, sind alle Komponenten auf neuestem Stand. Wenn du also etwas konkret wissen möchtest, stelle bitte auch konkrete Fragen.

@GuriSoft the command line output is

Last login: Sun Jan 29 19:42:23 on ttys000 Klaus-MacBook-Pro:~ klaus$ sudo npm install -g angular-cli Password: npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli" npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'github-url-from-git' npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /Users/klaus/npm-debug.log Klaus-MacBook-Pro:~ klaus$

KlausEichinger avatar Jan 29 '17 19:01 KlausEichinger

FYI: https://cli.angular.io/

KlausEichinger avatar Jan 29 '17 19:01 KlausEichinger

What happens if you re-install ng CLI ?

sudo npm uninstall -g angular-cli
sudo npm cache clean
sudo npm install -g angular-cli

Same error ?

catull avatar Jan 29 '17 20:01 catull

Do you have node modules in /usr/local/lib/node_modules, as well as in /Users/klaus/.npm ??

catull avatar Jan 29 '17 20:01 catull

What happens if you re-install ng CLI ? I did twice. Same error.

On my office mac I'd installed angular-cli successful two weeks ago. But I can't find any differences in the settings.

KlausEichinger avatar Jan 29 '17 20:01 KlausEichinger

Do you have node modules in /usr/local/lib/node_modules, as well as in /Users/klaus/.npm ??

I don't think npm is the problem. I can install other components like bootstrap via npm.

KlausEichinger avatar Jan 29 '17 20:01 KlausEichinger

Have you thought of giving yarn a chance ?

catull avatar Jan 29 '17 20:01 catull

Not yet.

I try to combine angular w/ react, because of a better rendering from react components. My experiences w/ npm are throughout positive.

KlausEichinger avatar Jan 29 '17 20:01 KlausEichinger

Actually, yarn is a different node package manager/installer. You'd have to install it from npm, or install it from https://yarnpkg.com/.

Once installed, you can do this:

sudo yarn global add angular-cli@latest

It works super-fast. Just did it again, and it was done in just under 70 seconds.

Can you try this ?

catull avatar Jan 29 '17 20:01 catull

I just tried to install Yarn. Sounds fine. But npm failed!

Klaus-MacBook-Pro:~ klaus$ sudo npm install -g yarn Password: npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "yarn" npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'github-url-from-git' npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

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

I will go up and clean up my Mac manually tomorrow.

KlausEichinger avatar Jan 29 '17 20:01 KlausEichinger

You see, about the same problem, to do with "Cannot find module 'github-url-from-git'" When was the last time you were able to install something successfully ?

catull avatar Jan 29 '17 20:01 catull

On my Mac, this is what I get with

npm -g list github-url-from-git
npm -g list github-url-from-git
/usr/local/lib
├── UNMET PEER DEPENDENCY @angular/compiler@<=2.3 >=2.2.0
├── UNMET PEER DEPENDENCY @angular/core@<=2.3 >=2.2.0
├── UNMET PEER DEPENDENCY [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├── UNMET PEER DEPENDENCY requirejs@^2.1.0
└── UNMET PEER DEPENDENCY [email protected]

Very suspicious, npm version 2.15.9 !!!

catull avatar Jan 29 '17 20:01 catull

Do you have node modules in /usr/local/lib/node_modules, as well as in /Users/klaus/.npm ?? in /usr/local/lib/node_modules there is a npm folder, in /Users/klaus/.npm there only a folder w/ node-modules-path

When was the last time you were able to install something successfully ? between the last two weeks ago

KlausEichinger avatar Jan 29 '17 20:01 KlausEichinger

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "list" "github-url-from-git"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'github-url-from-git'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/klaus/npm-debug.log
Klaus-MacBook-Pro:~ klaus$ 

KlausEichinger avatar Jan 29 '17 20:01 KlausEichinger