Skip to content
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

Cannot install via npm #4276

Closed
KlausEichinger opened this issue Jan 29, 2017 · 29 comments
Closed

Cannot install via npm #4276

KlausEichinger opened this issue Jan 29, 2017 · 29 comments

Comments

@KlausEichinger
Copy link

MacOS Sierra, node@v7.4.0, npm@4.0.5

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 npm@4.0.5
3 info using node@v7.4.0
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 ]

@catull
Copy link
Contributor

catull commented Jan 29, 2017

@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 ?

@AlexTCarneiro
Copy link

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...!

@clydin
Copy link
Member

clydin commented Jan 29, 2017

I'd also suggest updating npm.

@KlausEichinger
Copy link
Author

KlausEichinger commented Jan 29, 2017

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.

@catull
Copy link
Contributor

catull commented Jan 29, 2017

@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
Copy link
Contributor

catull commented Jan 29, 2017

If you search for the error "Cannot find module 'github-url-from-git'", there are plenty of hits, such as nodejs/node#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/.

@KlausEichinger
Copy link
Author

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
Copy link
Author

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

@catull
Copy link
Contributor

catull commented Jan 29, 2017

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
Copy link
Contributor

catull commented Jan 29, 2017

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

@KlausEichinger
Copy link
Author

KlausEichinger commented Jan 29, 2017

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
Copy link
Author

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.

@catull
Copy link
Contributor

catull commented Jan 29, 2017

Have you thought of giving yarn a chance ?

@KlausEichinger
Copy link
Author

Not yet.

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

@catull
Copy link
Contributor

catull commented Jan 29, 2017

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 ?

@KlausEichinger
Copy link
Author

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.

@catull
Copy link
Contributor

catull commented Jan 29, 2017

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
Copy link
Contributor

catull commented Jan 29, 2017

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 grunt@1.0.1
├─┬ nativescript@2.4.2
│ └─┬ npm@2.15.9
│   └── github-url-from-git@1.4.0
├── UNMET PEER DEPENDENCY requirejs@^2.1.0
└── UNMET PEER DEPENDENCY tslint@4.2.0

Very suspicious, npm version 2.15.9 !!!

@KlausEichinger
Copy link
Author

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
Copy link
Author

KlausEichinger commented Jan 29, 2017

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$ 

@catull
Copy link
Contributor

catull commented Jan 29, 2017

I am afraid, a clean-up is a MUST now.
But, if you successfully install angular-cli after that, please report back.

@KlausEichinger
Copy link
Author

I will do the clean-up and report. Thank for supporting

@catull
Copy link
Contributor

catull commented Jan 29, 2017

Gern geschehen.

@KlausEichinger
Copy link
Author

KlausEichinger commented Jan 29, 2017

Installed packages for tooling via npm.
Project 'angularreact' successfully created.
Klaus-MacBook-Pro:dev klaus$```

After removing manually all node* occurrences 
([helpful link](http://stackabuse.com/how-to-uninstall-node-js-from-mac-osx/) 
and reinstalling Node – it works

@catull
Copy link
Contributor

catull commented Jan 29, 2017

@KlausEichinger

I am glad it is working for you now.
Thanks for letting us know.

By the way, the link is better rendered this way: helpful link, you added an extra '(' in front. You could have added an extra ')' at the end and it would have been correctly rendered, too.

You can see the textual effect of your comment by switching between the "Write" and "Preview" tab, before you submit it.

After the fact, you can always go back and choose the "pen" symbol to edit a comment you wrote.

@Brocco
Copy link
Contributor

Brocco commented Jan 30, 2017

Glad you were able to find a solution to your issue, closing.

@Brocco Brocco closed this as completed Jan 30, 2017
@amulyaalva
Copy link

npm ERR! Please include the following file with any support request:
npm ERR! C:\amulya\angular cli projects\first\npm-debug.log

can you help me out how to solve this problem

@amulyaalva
Copy link

when i amtrying to run angular4 with command npm-serve,it is showing the following error?
how to solve this problem..

Specify configs in the ini-formatted file:
C:\Users\Aravind.npmrc
or on the command line via: npm --key value
Config info can be viewed via: npm help config

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants