File path limitation when installing on Windows
freeman42x opened this issue · comments
When npm i grunt-reduce
to a path as short as D:\TP\
it throws a build error for an optional dependency:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\Programs\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:2
67:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "D:\\Programs\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuil
d"
gyp ERR! cwd D:\TP\node_modules\grunt-reduce\node_modules\assetgraph-builder\node_modules\express-processimage\node
_modules\svgfilter\node_modules\assetgraph\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN optional dep failed, continuing svgfilter@0.3.1
As mentioned here: http://support.microsoft.com/kb/316010 it might be file path length related. When installing on a longer path it threw a different error that actually mentioned it was related to path length.
Installing directly in root D:\
throws no error.
Is there any way to get past this error in an elegant way without installing in root?
It's an optional dependency failing. It's the image optimization that dependes on node-canvas, which has a dependency chain needing contextify. We marked this whole dependency chain as optional specificly because of that. The requirements for making this run are not default installed on many operating systems, especially not windows.
Your build should run fine, allthough with less image optimization
I was hoping there might be some solution to this problem, maybe using symbolic links somehow and moving the child node_modules directly under root node_modules when there are no version conflicts.