-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: switch from npm to yarn #19328
Conversation
4a493a5
to
2ffe9d9
Compare
You can preview c706fc2 at https://pr19328-c706fc2.ngbuilds.io/. |
You can preview 53f4f45 at https://pr19328-53f4f45.ngbuilds.io/. |
Just out of curiosity. Why not just use npm v5? It should be almost as fast as yarn. Or is there another reason besides speed improvements? |
We still need to support old versions of node for some tests, which I believe that the new npm doesn't. And yarn is still faster for now, see https://medium.com/@nikjohn/npm-5-yarn-killer-ba69737b24d0 |
Ok, thanks for the clarification. |
You can preview 9c1a8d5 at https://pr19328-9c1a8d5.ngbuilds.io/. |
@@ -56,7 +58,7 @@ Next, install the JavaScript modules needed to build and test Angular: | |||
|
|||
```shell | |||
# Install Angular project dependencies (package.json) | |||
npm install | |||
yarn install | |||
``` | |||
|
|||
**Optional**: In this document, we make use of project local `npm` package scripts and binaries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also remove Options 1, 2 and 3? they all refer to installing global dependencies, using npm with yarn projects, and using sudo which are all anti-patterns and shouldn't be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
package.json
Outdated
@@ -17,7 +17,8 @@ | |||
"url": "https://github.com/angular/angular.git" | |||
}, | |||
"scripts": { | |||
"postinstall": "node tools/npm/copy-npm-shrinkwrap && webdriver-manager update", | |||
"preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/')\"", | |||
"postinstall": "webdriver-manager update", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add the --gecko false
flag here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if it would fail something with this here, I'll add it
* If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new | ||
* date, some browsers (e.g. IE 9) will throw an invalid Date error | ||
* If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the | ||
* timeoffset is applied Note: ISO months are 0 for January, 1 for February, ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad line join
yarn.lock.readme.md
Outdated
or `yarn upgrade <packagename> --dev` to update to the latest version that matches version constraint | ||
in `package.json` | ||
|
||
To Remove an existing dependency do the following: run `yarn remove <packagename>@<version|latest>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to specify the version
in this case
scripts/ci/env.sh
Outdated
@@ -37,7 +37,7 @@ fi | |||
setEnvVar NODE_VERSION 6.9.5 | |||
setEnvVar NPM_VERSION 3.10.7 # do not upgrade to >3.10.8 unless https://github.com/npm/npm/issues/14042 is resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
You can preview 4976e0b at https://pr19328-4976e0b.ngbuilds.io/. |
fyi on error-reporting: I had node 4 and the
not sure if it's worth fixing (by checking node version first I suppose) |
The node engine in package.json is |
Right, not asking for support, I'm just pointing out the error isn't very nice. |
@@ -8,6 +8,6 @@ echo "#################################" | |||
echo "Running platform-server end to end tests" | |||
echo "#################################" | |||
|
|||
npm install | |||
yarn install | |||
|
|||
npm run test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yarn test
? 😞 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, it'll be in my follow up PR, thanks
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
We use npm to install and lock our dependencies (with shrinkwrap)
What is the new behavior?
We use yarn instead of npm
Does this PR introduce a breaking change?