profile
viewpoint

Ask questionsError: spawnSync /bin/sh ENOENT

let { execSync: exec } = require('child_process');
let os = require('os');

let tmp = os.tmpdir();

exec(`npm install --prefix ${tmp}`, {
        cwd: './',
	encoding: 'utf8',
	stdio: 'inherit'
});
child_process.js:531
    throw err;
    ^

Error: spawnSync /bin/sh ENOENT
    at exports._errnoException (util.js:1026:11)
    at spawnSync (child_process.js:466:20)
    at execSync (child_process.js:522:13)
    at Cache.installModules (/index.js:173:3)
    at Object.<anonymous> (/install.js:11:7)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
  • Version: v7.0.0
  • Platform: 3.10.8
  • Subsystem: Darwin (MacOS Sierra 10.12.1 (16B2555)) Darwin local 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64

Please read my another issue before

nodejs/node

Answer questions yujintang

options.shell: true; perhaps can solved it

useful!
source:https://uonfu.com/
Github User Rank List