Don't symlink node_modules on Windows

because symlinking is hard
This commit is contained in:
Slava Kim
2014-12-11 17:26:23 -08:00
committed by Sashko Stubailo
parent 9db7c37737
commit 70392aec79
2 changed files with 10 additions and 3 deletions

View File

@@ -323,10 +323,16 @@ _.extend(Builder.prototype, {
throw new Error("can't copy only specific paths with a single symlink");
}
var canSymlink = true;
if (self.usedAsFile[normOptionsTo]) {
throw new Error("tried to copy a directory onto " + normOptionsTo +
" but it is is already a file");
}
var canSymlink = true;
// Symlinks don't work exactly the same way on Windows, and furthermore
// they request Admin permissions to set.
if (process.platform === 'win32') {
canSymlink = false;
} else if (normOptionsTo in self.usedAsFile) {
// It's already here and is a directory, maybe because of a call to
// reserve with {directory: true}. If it's an empty directory, this is

View File

@@ -1682,8 +1682,9 @@ _.extend(ServerTarget.prototype, {
// install' using the above package.json and npm-shrinkwrap.json on every
// rebuild).
if (options.includeNodeModulesSymlink) {
builder.write('node_modules', {
symlink: files.pathJoin(files.getDevBundle(), 'server-lib', 'node_modules')
builder.copyDirectory({
from: files.pathJoin(files.getDevBundle(), 'lib', 'node_modules'),
to: 'node_modules'
});
}