forked from jackjdleslie/neptune-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenforce-yarn.js
26 lines (21 loc) · 895 Bytes
/
enforce-yarn.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const isUsingYarn = process.env.npm_execpath.indexOf('yarn') >= 0;
// Detect if run by NPM and fail
if (!isUsingYarn) {
console.log(`
This project recently transitioned to using yarn (https://yarnpkg.com/) for package
management instead of npm. The build servers use yarn, so developers should too.
Basics:
$ see yarnpkg.com for installation of yarn
$ yarn install
To install a new package (also adds to package.json):
$ yarn add [packagename]
To upgrade a package:
$ yarn upgrade [packagename]
For more help, see https://yarnpkg.com/en/docs/usage.
Reasons for this change:
- yarn uses a dependency lockfile by default, allowing for a fully reproducible build
- yarn is faster to install dependencies from scratch
- yarn has more secure checksum matching, ensuring package contents are consistent
`);
process.exit(1);
}