Do not use npm ()

Both of yarn and npm are used in Mastodon, but the combined usage requires
a redundant dependency and may lead to data inconsistency.

Considering that yarn has autoclean feature which npm does not have,
this change replaces all npm usage with yarn.

This change requires documentation update. Most notably, the following
command must be executed before assets precompilation if any system
dependency of node-sass has changed:

yarn install --force --pure-lockfile
This commit is contained in:
Akihiko Odaki 2018-03-07 05:36:46 +09:00 committed by Eugen Rochko
parent a07cfee644
commit 81cefc1913
3 changed files with 3 additions and 5 deletions

View File

@ -38,7 +38,6 @@ RUN apk -U upgrade \
libidn \ libidn \
libpq \ libpq \
nodejs \ nodejs \
nodejs-npm \
protobuf \ protobuf \
su-exec \ su-exec \
tini \ tini \

View File

@ -55,7 +55,7 @@ services:
image: gargron/mastodon image: gargron/mastodon
restart: always restart: always
env_file: .env.production env_file: .env.production
command: npm run start command: yarn start
networks: networks:
- external_network - external_network
- internal_network - internal_network

View File

@ -10,10 +10,9 @@
"build:production": "cross-env RAILS_ENV=production ./bin/webpack", "build:production": "cross-env RAILS_ENV=production ./bin/webpack",
"manage:translations": "node ./config/webpack/translationRunner.js", "manage:translations": "node ./config/webpack/translationRunner.js",
"start": "node ./streaming/index.js", "start": "node ./streaming/index.js",
"test": "npm run test:lint && npm run test:jest", "test": "yarn run test:lint && yarn run test:jest",
"test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ streaming/", "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ streaming/",
"test:jest": "cross-env NODE_ENV=test jest --coverage", "test:jest": "cross-env NODE_ENV=test jest --coverage"
"postinstall": "npm rebuild node-sass"
}, },
"repository": { "repository": {
"type": "git", "type": "git",