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

New node v8.4.0 and 8.5.0 installation broken npm #305

Closed
10 of 28 tasks
Zorgatone opened this issue Sep 26, 2017 · 13 comments
Closed
10 of 28 tasks

New node v8.4.0 and 8.5.0 installation broken npm #305

Zorgatone opened this issue Sep 26, 2017 · 13 comments

Comments

@Zorgatone
Copy link

Zorgatone commented Sep 26, 2017

My Environment

  • Windows 7 or below (not truly supported due to EOL - see wiki for details)

  • Windows 8

  • Windows 8.1

  • Windows 10

  • Windows 10 IoT Core

  • Windows Server 2012

  • Windows Server 2012 R2

  • Windows Server 2016

  • My Windows installation is non-English.

I'm using NVM4W version:

  • 1.1.6
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • Older
  • OTHER (Please Specify)

I have already...

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn't already been resolved.
  • verified I'm using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn't a duplicate.
  • made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • settings.txt
  • proxy support (Have you tried version 1.1.0+?)
  • 32 or 64 bit support (Have you tried version 1.1.3+?)
  • Character escaping (Have you tried version 1.1.6+?)
  • A standard shell environment (terminal/powershell)
  • A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

Install a working copy of latest Node JS and NPM

Actual Behavior

Installing seems to be completed and activated correctly. The Node interpreter seems to be the latest version and working. NPM seems to be the latest version but missing some node_modules dependencies. It won't load and even print --help or --version

Steps to reproduce the problem:

I opened my console (tried CMD not as admin (but admin user), open CMD with privileges, or even Powershell with or without privileges, disabled my AV - ESET Smart Security) and tried to install node 8.5.0 with the command nvm install 8.5.0 and even with the command nvm install latest 64 --insecure.

Both produce the same output and no errors on installation. Then I switch to the new version with nvm use 8.5.0 and loads the new version correctly. node --version and node seem to be working ok, nvm *anything* won't work (missing packages in npm's node_modules dependencies, complaining about semver first, then I tried to add all of them and update npm with npm install --global npm but will say that it won't find npm@undefined even if I specify a version).

Here's the output of my console (here using Cmder running cmd, on Windows 10 x64) when I try to get a new version of Node (I think 8.x won't work, as also noted for 8.4.0 here in issue #302, and here in version 8.5.0):

C:\Users\zorgatone
λ nvm install latest 64 --insecure
Downloading node.js version 8.5.0 (64-bit)... Complete
Creating C:\Users\zorgatone\AppData\Roaming\nvm\temp

Downloading npm version 5.3.0... Complete
Installing npm v5.3.0...

Installation complete. If you want to use this version, type

nvm use 8.5.0

C:\Users\zorgatone
λ nvm use 8.5.0
Now using node v8.5.0 (64-bit)

C:\Users\zorgatone
λ node --version
v8.5.0

C:\Users\zorgatone
λ npm --version
module.js:529
    throw err;
    ^

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\zorgatone\AppData\Roaming\nvm\v8.5.0\node_modules\npm\lib\utils\unsupported.js:2:14)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
module.js:529
    throw err;
    ^

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\zorgatone\AppData\Roaming\nvm\v8.5.0\node_modules\npm\lib\utils\unsupported.js:2:14)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
@coreybutler
Copy link
Owner

Duplicate of #302. Potentially related to #300 (needs discovery).

@Zorgatone
Copy link
Author

@coreybutler yes, it's a duplicate of #302, as I said. Just trying to fill more informations about my environment and the steps to replicate

@coreybutler
Copy link
Owner

coreybutler commented Sep 26, 2017

@Zorgatone - which is it?

image
^^ Checked using the standard terminal

image
^^ Says you're using Cmder

The standard shell is not the same as cmder, even if you're running cmd from within Cmder. These specialized shells are known to cause issues (with more than just nvm-windows).

I did notice you're just trying to list the npm version, as opposed to installing semver. However; I still cannot recreate this in a standard terminal. I tried it in Cmder, and can't recreate it there either.

I strongly suspect you're not getting a complete download of npm, which has semver as a dependency. Check the global node_modules\npm\node_modules\semver to make sure it exists. If it doesn't exist or is empty, you likely got a bad download of npm.

@coreybutler coreybutler reopened this Sep 26, 2017
@Zorgatone
Copy link
Author

@coreybutler checked also non-standard shell now, I forgot to click on the checkbox of both of them (I had tried on both terminals).

Also I said I tried to add the missing dependencies (which means node_modules\npm\node_modules\semver was missing and a lot more packages in the same directory level). I downloaded more and more times and same problem. I don't know what else to try

@coreybutler
Copy link
Owner

@Zorgatone - are you using a proxy or behind a firewall? The node executable is downloaded from the node releases on nodejs.org, but npm comes from https://github.com/npm/npm/archive by default, i.e. https://github.com/npm/npm/archive/v5.4.0.zip, which redirects to a different github URL (I believe https://codeload.github.com/npm/npm/zip/v5.4.0.zip?)

If you're getting part of npm, but not the whole thing, the only thing I can think of is a network error. Proxies can cause this (i.e. not following a redirect, blocking domains, etc), and sometimes geographic location can cause this (network latency). Based on your profile, it looks like you're in Italy? It may be worth trying an npm mirror, though I'm not sure which is closest to you.

@Zorgatone Zorgatone mentioned this issue Oct 5, 2017
28 tasks
@alesmenzel
Copy link

Hello, any update on this? I am still experiencing similar issue - after installing node 8.5.0 the NPM is no longer accessible from a terminal - i guess the paths are busted.

@Zorgatone
Copy link
Author

@coreybutler No, I wasn't using a proxy. I was using my home Wi-Fi connection (which is slow, but shouldn't lose packets that I know of, and I tried several times to download).

I will try again this weekend to see if I can get it working on default Windows' CMD

@msatgh
Copy link

msatgh commented Oct 12, 2017

I have exactly the same problem that is described by zorgatone. node 6.x works but not 8.4 or newer. Same error "semver is missing..."

@talesporto
Copy link

I have the same problem too.

@seevee
Copy link

seevee commented Nov 15, 2017

Same problem on Windows Server 2012 R2. Tested with 8.5.0, 8.7.0, and 8.9.1. Had to install node manually from nodejs.org to resolve.

@coreybutler
Copy link
Owner

@alesmenzel Unfortunately, no - I've been insanely busy lately. There's definitely an issue in npm and it's expected locations, so a workaround will be necessary.

@alesmenzel
Copy link

@coreybutler Thanks for response. I have managed to get it working with the latest node (8.9.1) and the 1.1.6 prerelease of nvm. There is small caveat though. I had to enable long paths in windows as npm was crashing on that.

@b-dur
Copy link

b-dur commented Apr 17, 2018

Closing issue as it is duplicate of #302

@b-dur b-dur closed this as completed Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants