diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js new file mode 100644 index 00000000000..d70393040fd --- /dev/null +++ b/build/npm/preinstall.js @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var win = "Please run '.\\scripts\\npm.bat install' instead." +var nix = "Please run './scripts/npm.sh install' instead." + +if (process.env['npm_config_disturl'] !== 'https://atom.io/download/atom-shell') { + console.error("You can't use plain npm to install Code's dependencies."); + console.error(/^win/.test(process.platform) ? win : nix); + process.exit(1); +} \ No newline at end of file diff --git a/package.json b/package.json index 5badd18213f..2500de069f0 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "scripts": { "test": "node node_modules/mocha/bin/_mocha", + "preinstall": "node build/npm/preinstall.js", "postinstall": "npm --prefix extensions/csharp-o/ install extensions/csharp-o/ && npm --prefix extensions/vscode-api-tests/ install extensions/vscode-api-tests/" }, "dependencies": {