Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install node.js under Windows 7: "the specified path is too long"

Using the newest node.js installer from https://nodejs.org, I run into the same error every time when it reaches the npm installation. npm 3.x was supposed to deal with this issue, but apparently it doesn't help the node.js installer. The node developers have essentially refused to do anything about it, as this problem has been around for about two years already. Unfortunately, I can't seem to find a work around. How can I get this to install?

like image 645
Fibericon Avatar asked Feb 21 '17 09:02

Fibericon


2 Answers

I also had this error, trying to install node-v8.10.0-x64.msi on Windows 10.

My solution (to getting it to install; no idea if it won't break further down the line) was changing the install directory from C:/Program Files/nodejs to C:/njs/ (2nd step of current setup process).

I'm surprised those characters made the difference, and that there even is a Windows node release if there's not a proper solution to this (can't believe that maximum path length on Windows isn't modifiable), but this has seemingly worked for me.

like image 141
Oli Beatson Avatar answered Nov 14 '22 11:11

Oli Beatson


I don't think its an installer error, actually windows is restricting the path size to be 150 char.

try reducing the file path name by copying it into direct c or d drive.

Check the link below Microsoft Forum

like image 29
smali Avatar answered Nov 14 '22 12:11

smali