fix(lifecycle): don't set NODE_PRESERVE_SYMLINKS to 1

With the new store and node_modules structure the pnpm leverages
symlinks preserving is not only unnecessary, it hurts.
This commit is contained in:
zkochan
2017-01-25 22:57:26 +02:00
parent fa241d30a6
commit 4e9fdc1477
3 changed files with 0 additions and 37 deletions

View File

@@ -56,6 +56,5 @@ function createEnv (cwd: string) {
path.dirname(process.execPath),
process.env[PATH]
].join(path.delimiter)
env['NODE_PRESERVE_SYMLINKS'] = '1'
return env
}

View File

@@ -5,4 +5,3 @@ import './uninstall'
import './link'
import './prune'
import './cache'
import './run'

View File

@@ -1,35 +0,0 @@
import tape = require('tape')
import promisifyTape from 'tape-promise'
const test = promisifyTape(tape)
import semver = require('semver')
import fs = require('mz/fs')
import prepare from './support/prepare'
import testDefaults from './support/testDefaults'
import {installPkgs} from '../lib'
import runCmd from '../lib/cmd/run'
const preserveSymlinksEnvVariable = semver.satisfies(process.version, '>=7.1.0')
test('run node in scripts with preserve symlinks mode', async function (t) {
if (!preserveSymlinksEnvVariable) {
t.skip('this test is only for Node.js >= 7.1.0')
return
}
prepare(t, {
scripts: {
test: 'node index'
}
})
await fs.writeFile('index.js', `
const fs = require('fs')
const symlinksPreserved = require('symlinks-preserved')
fs.writeFileSync('test-result', symlinksPreserved, 'utf8')
`, 'utf8')
await installPkgs(['symlinks-preserved'], testDefaults())
const result = runCmd(['test'], {})
t.equal(result.status, 0, 'executable exited with success')
t.equal(await fs.readFile('test-result', 'utf8'), 'true', 'symlinks are preserved')
})