-
-
Save xexi/70f78e4e2a87fa69f4dcdedf452831cb to your computer and use it in GitHub Desktop.
check NODE_PATH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!process.env.NODE_PATH) { | |
console.log(); | |
if (process.env.SHELL === '/bin/zsh') { | |
console.log(' Please set environment variable NODE_PATH in ~/.zshrc:'); | |
} else if (process.env.SHELL === '/bin/bash') { | |
console.log(' Please set environment variable NODE_PATH in ~/.bashrc:'); | |
} else { | |
console.log(' Please set environment variable NODE_PATH:'); | |
} | |
console.log(); | |
var nodepath = __dirname.replace(/(\/|\\)nico(\/|\\)bin$/, ''); | |
if (/node_modules$/.test(nodepath) && !fs.existsSync(path.join(nodepath, '.bin'))) { | |
if (os.platform() === 'win32') { | |
console.log(' NODE_PATH=' + nodepath); | |
} else { | |
console.log(' export NODE_PATH=' + nodepath); | |
} | |
} | |
console.log(); | |
process.exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment