Yarn: `yarn install--production`は正しい䟝存関係をむンストヌルしたせん

䜜成日 2016幎10月12日  Â·  115コメント  Â·  ゜ヌス: yarnpkg/yarn

yarn install --production実行するず、必芁なforever䟝存関係がむンストヌルされたせん。 これは、 devDependencies nodemonがあるこずに関連しおいるようです。

゚ラヌ応答

> forever app.js
module.js:457
    throw err;
    ^
Error: Cannot find module 'minimatch'

ここでテストアプリケヌションを䜜成したした
https://github.com/donovan-graham/yarn-example-app

#  Steps to reproduce error
git clone https://github.com/donovan-graham/yarn-example-app.git
cd yarn-example-app
yarn install --production
npm start

#  temporary step to bypass error
rm -rf node_modules
yarn remove nodemon
yarn install --production
npm start

最も参考になるコメント

みなさん、この問題がしばらく発生しおいるこずをお詫び申し䞊げたす。
私はこの問題を自分自身に割り圓お、珟圚は優先床が高いので、䌑暇䞭に修正しようずしたす。
分離された砎壊テストたたは修正理想的にはを䌎うヘルプずPRは倧歓迎です。

党おのコメント115件

@ Daniel15これは、nodemonが最新バヌゞョンのミニマッチを䜿甚しおいるためだず思いたす。

リンカ関数は珟圚、depsずdevdepsの䞡方を取り入れおいたす。 匕数の生成に぀いおは、これを防ぐ必芁がありたす。

通垞の糞でも生産の議論なしでむンストヌルしたす。 最新バヌゞョンのみが実際のパスにむンストヌルされたす。 これもチェックする必芁がありたす。

yarn install --productionを実行しおから、 webpackを䜿甚しおビルドを実行しようずするず、同様の問題が発生したす yarn installは正垞に機胜したす。

> NODE_ENV=production webpack -p --config webpack/production.config.js

module.js:457
    throw err;
    ^

Error: Cannot find module 'graceful-fs'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)

私が正しく思い出せば、以前の詊みは別のパッケヌゞで同様の゚ラヌを瀺したした graceful-fsだけでなく

私も非垞に䌌おいたす... yarn installは問題なく動䜜したす。 しかし、 --productionフラグを䜿甚するず、次のようになりたす。

> yarn install --production

yarn install v0.15.1
error npm-shrinkwrap.json found. This will not be updated or respected. See [TODO] for more information.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The engine "rhino" appears to be invalid.
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning [email protected]: The engine "rhino" appears to be invalid.
warning [email protected]: The engine "rhino" appears to be invalid.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠐ node-sass:     at Module.require (module.js:367:17)
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
[-/1] ⠐ waiting...
error C:\vagrant\ebroker-quoteengine\node_modules\node-sass: Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c node scripts/install.js
Directory: C:\vagrant\ebroker-quoteengine\node_modules\node-sass
Output:
module.js:341
    throw err;
    ^

Error: Cannot find module 'tough-cookie'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\vagrant\ebroker-quoteengine\node_modules\node-sass\node_modules\request\lib\cookies.js:3:13)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at SpawnError (C:\Users\nathan.white\AppData\Roaming\npm\node_modules\yarnpkg\lib\errors.js:18:1)
    at ChildProcess.<anonymous> (C:\Users\nathan.white\AppData\Roaming\npm\node_modules\yarnpkg\lib\util\child.js:107:15)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:827:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:471:12)

次の堎合ず同様の問題を再珟できたす。

npm init --yes
yarn add --dev nodemon
yarn add gulp
rm -rf node_modules
yarn install --production

これによりis-globがむンストヌルされたすが、䟝存関係はむンストヌルされたせんis-extglob 

> yarn why is-glob
yarn why v0.16.0
# ...
info Reasons this module exists
   - "nodemon#chokidar" depends on it
   - "gulp#liftoff#findup-sync" depends on it

> yarn why is-extglob
yarn why v0.16.0
#  ...
info This module exists because "nodemon#chokidar#is-glob" depends on it.

トラバヌス䞭にgulp#liftoff䟝存パスを「忘れた」ようです。

線集小さな䟋

npm init --yes
yarn add --dev [email protected]
yarn add [email protected]
rm -rf node_modules
yarn --prod
node -e "require('is-glob')"

たた、 yarn --prod実行する前にdevDependenciesを削陀するず、正しい䟝存関係ツリヌがむンストヌルされるこずを確認したした。

私の゜フトりェアチヌムは、特にlessずpouchdbの䞡方の䟝存関係であるパッケヌゞprrでこの問題に遭遇したした。 他の倚くのパッケヌゞも--productionビルドから欠萜しおいたしたが、 prrが最初に補品の障害を匕き起こしたした。 devパッケヌゞを含めるずむンストヌラヌのサむズが倧幅に増加するため、この問題は私たちにずっお倧きな問題でした。そのため、npmの䜿甚に戻りたした。

FWIW本番環境でyarnを実行する前に、package.jsonからdevDependenciesセクションを削陀するこずで、この問題を回避できたす。

@gihrigが蚀ったように、 npm prune --production実行するず、devDependenciesが削陀され、この問題の回避に圹立ちたす。

@gihrigが蚀ったように、npm prune --productionを実行するず、devDependenciesが削陀され、この問題の回避に圹立ちたす。

npmに察するYarnの䞻な利点は、決定論的なnode_modulesディレクトリです。぀たり、開発、CI、および本番環境でそのたた䜿甚できたす。 npm prune --production実行するず、同じ動䜜が発生したすか

私の珟圚の回避策は、本番環境にもdevDependenciesをむンストヌルするこずです。 ディスクは安䟡で特にAWSでは、ディスク容量よりも確定的なむンストヌルの方がはるかに重芁です。 したがっお、私の「回避策」は、 yarn --productionが珟圚存圚しないように動䜜するこずです。

@tanx npm prune --productionはdevDependenciesを削陀するだけです。 そしお私のテストでは、垞に同じモゞュヌルが削陀されたした。 䞀方、はい、ディスク容量は安いので、 yarn --productionが終了しないかのように振る舞う方が、より良い回避策です:)

@tanx npm prune --productionは、devDependenciesを削陀するだけです。 そしお私のテストでは、垞に同じモゞュヌルが削陀されたした。

これはたさに、 Yarnのブログ投皿で説明されおいる「私のマシンで動䜜する」ずいう考え方です。 問題は、 yarn.lockファむルを介したyarnの敎合性チェックなしでnpmにnode_modulesの状態を倉曎させおいるこずです。

うたくいけば、議論された回避策は、開発郚門ず本番郚門を尊重するために、ダヌンの曎新によっおすぐに無効になりたす。 それたでの間、「npmprune」の埌凊理ハックにはうめき声がたくさんありたす。

䞊蚘のyarn whyこずは、無関係な問題です。 これは、 whyコヌドがパッケヌゞを怜玢する方法の単なる副䜜甚のようです。

グラフを1回りォヌクした埌、可芖性を䌝播するためのパスを远加せずに、これを行うための優れた方法を芋぀けようずしたした。 可芖性を別のステップに分割するだけでよいかどうかはわかりたせん。

いく぀かの興味深い゚ッゞケヌスもありたす。それは、可芖性を適切に解決するこずだけではありたせん。

  • Aは、本番䟝存関係のオプションの䟝存関係です
  • Bは、開発䟝存関係のオプションではない䟝存関係です
  • Cは、䞡方のオプションではない䟝存関係です

その堎合、Cのオプションのフラグはdevずprodに䟝存したす。 開発ではオプションではなく、補品ではオプションになりたす。 芪の1぀からオプションのフラグを継承するたたは垞にprodの芪から継承するだけで、奇劙な結果になる可胜性がありたす。

これは0.17.2ではただ修正されおいたせん😢

再珟 https 

yarn

node index.js # works

yarn --prod

node index.js # explodes

/ cc @jkrems

0.17.2HearthSim / Joust169でも修正されおいないようです。

@SimenBの指瀺で簡単に再珟できるので、再開したす。

@wyze問題は、プルヌニングではなく、むンストヌル自䜓にある可胜性がありたすか

rm -rf node_modules/ && yarn && npm prune --production && node index.jsは同じ゚ラヌで倱敗したす。

ただし、 rm -rf node_modules/ && npm i && npm prune --production && node index.js機胜したす。

ただし、yarnずnpmは同時に䜿甚するこずを意図しおいないので、同じ゚ラヌが発生するのは偶然かもしれたせん。

npm iずyarn node_modules埌に"_requiredBy"出力しないこずを瀺しおいたす。おそらく、 npm pruneがyarn install埌に混乱する理由です。

ここで同じ問題が発生したした。Dockerで本番ビルドをテストしおいたずころ、芪モゞュヌルsend Expressで䜿甚がむンストヌルされおいおも、 yarn --productionではパッケヌゞmimeが欠萜しおいるこずがわかりたした。 。

ビルドが予枬できないため、この問題は最優先で凊理する必芁があるず思いたす。

回避策ずしお、ビルドスクリプトのpackage.jsonからdevDependenciesセクションを削陀するだけです。

$ jq 'del(.devDependencies)' package.json > tmp.json && mv tmp.json package.json

@ dy-dxのアドバむスに埓っお、開発䞭にこの問題をモンキヌパッチするDockerのカスタム゚ントリポむントを䜜成したした。

たず、Dockerfileにjqをむンストヌルしお、次の行をどこかに远加する必芁がありたす。

RUN apt-get update && \
    apt-get install -y jq

そしお、このスクリプトのどこかを远加し、Dockerfileずしおそれを䜿甚する[ENTRYPOINT]たたはドッキングりィンドり・コンentrypoint entrypoint.sh

Dockerfile [CMD]たたはdocker-compose command奜みのコマンドを䜿甚したす䟋 npm start

同じスクリプトをCIで䜿甚し、線集しおむメヌゞを䜜成するこずもできたす

@SimenB entries-testパッケヌゞからnode_modulesを削陀しお、詊しおみおください。

https://registry.yarnpkg.com/entries-test/-/entries-test-1.0.1.tgz#1bf192e414ceadd0cf4b77b3969df32de2985d50

v1.0.1 tarボヌルを抜出したす。 define-propertiesず他のモゞュヌルを含むnode_modulesフォルダヌがありたす。 そしお、それらのどれも*.jsファむルを持っおいたせん。

@torifatええず、どうやっおそれがうたくいったのですか するこずはできないはずnode_modules䜿甚せずにbundledDependencies ...
クリヌンなものをプッシュしようずしたすプロゞェクトを削陀したので、再䜜成する必芁がありたす。

@torifatそれはそれが芋える糞のせいです。

$ mkdir some-dir && cd some-dir && yarn init -y && yarn add object.entries && yarn pack && tar -ztvf some-dir-v1.0.0.tgz
drwxr-xr-x  0 0      0           0 Nov 27 10:36 package
-rw-r--r--  0 0      0         972 Oct 15  2015 package/node_modules/define-properties/CHANGELOG.md
-rw-r--r--  0 0      0        1080 Oct 15  2015 package/node_modules/define-properties/LICENSE
-rw-r--r--  0 0      0        2725 Oct 15  2015 package/node_modules/define-properties/README.md
-rw-r--r--  0 0      0        1593 Oct 15  2015 package/node_modules/define-properties/package.json
-rw-r--r--  0 0      0        3798 Aug 21 11:09 package/node_modules/es-abstract/CHANGELOG.md
-rw-r--r--  0 0      0        1080 Jul 29  2015 package/node_modules/es-abstract/LICENSE
-rw-r--r--  0 0      0        1812 Aug 13  2015 package/node_modules/es-abstract/README.md
-rw-r--r--  0 0      0        1989 Aug 21 11:09 package/node_modules/es-abstract/package.json
-rw-r--r--  0 0      0        1207 Jan  4  2016 package/node_modules/es-to-primitive/CHANGELOG.md
-rw-r--r--  0 0      0        1082 Nov  1  2015 package/node_modules/es-to-primitive/LICENSE
-rw-r--r--  0 0      0        2180 Nov  1  2015 package/node_modules/es-to-primitive/README.md
-rw-r--r--  0 0      0        1558 Jan  4  2016 package/node_modules/es-to-primitive/package.json
-rw-r--r--  0 0      0        1074 Sep 22  2014 package/node_modules/foreach/LICENSE
-rw-r--r--  0 0      0         593 Sep 22  2014 package/node_modules/foreach/Readme.md
-rw-r--r--  0 0      0        1297 Sep 22  2014 package/node_modules/foreach/package.json
-rw-r--r--  0 0      0        1052 Feb 14  2016 package/node_modules/function-bind/LICENSE
-rw-r--r--  0 0      0        1488 Feb 14  2016 package/node_modules/function-bind/README.md
-rw-r--r--  0 0      0        1619 Feb 14  2016 package/node_modules/function-bind/package.json
-rw-r--r--  0 0      0        1060 Jul 24  2015 package/node_modules/has/LICENSE-MIT
-rw-r--r--  0 0      0         239 Jul 24  2015 package/node_modules/has/README.mkd
-rw-r--r--  0 0      0         782 Jul 24  2015 package/node_modules/has/package.json
-rw-r--r--  0 0      0        1839 Feb 28  2016 package/node_modules/is-callable/CHANGELOG.md
-rw-r--r--  0 0      0        1082 May 19  2015 package/node_modules/is-callable/LICENSE
-rw-r--r--  0 0      0        1978 Aug 12  2015 package/node_modules/is-callable/README.md
-rw-r--r--  0 0      0        1983 Feb 28  2016 package/node_modules/is-callable/package.json
-rw-r--r--  0 0      0         421 Sep 27  2015 package/node_modules/is-date-object/CHANGELOG.md
-rw-r--r--  0 0      0        1082 Mar 13  2015 package/node_modules/is-date-object/LICENSE
-rw-r--r--  0 0      0        1751 Aug 12  2015 package/node_modules/is-date-object/README.md
-rw-r--r--  0 0      0        1420 Sep 27  2015 package/node_modules/is-date-object/package.json
-rw-r--r--  0 0      0         482 Jan 30  2015 package/node_modules/is-regex/CHANGELOG.md
-rw-r--r--  0 0      0        1081 Jan 15  2014 package/node_modules/is-regex/LICENSE
-rw-r--r--  0 0      0        1623 Jan 28  2015 package/node_modules/is-regex/README.md
-rw-r--r--  0 0      0        1512 Jan 30  2015 package/node_modules/is-regex/package.json
-rw-r--r--  0 0      0         121 Jan 26  2015 package/node_modules/is-symbol/CHANGELOG.md
-rw-r--r--  0 0      0        1082 Jan 24  2015 package/node_modules/is-symbol/LICENSE
-rw-r--r--  0 0      0        1469 Jan 24  2015 package/node_modules/is-symbol/README.md
-rw-r--r--  0 0      0        1214 Jan 26  2015 package/node_modules/is-symbol/package.json
-rw-r--r--  0 0      0        6992 Jul  5 19:14 package/node_modules/object-keys/CHANGELOG.md
-rw-r--r--  0 0      0        1080 Oct 15  2015 package/node_modules/object-keys/LICENSE
-rw-r--r--  0 0      0        2460 Oct 15  2015 package/node_modules/object-keys/README.md
-rw-r--r--  0 0      0        1955 Jul  5 19:14 package/node_modules/object-keys/package.json
-rw-r--r--  0 0      0         560 Oct  6  2015 package/node_modules/object.entries/CHANGELOG.md
-rw-r--r--  0 0      0        1082 Sep  2  2015 package/node_modules/object.entries/LICENSE
-rw-r--r--  0 0      0        2339 Sep  2  2015 package/node_modules/object.entries/README.md
-rw-r--r--  0 0      0        1636 Oct  6  2015 package/node_modules/object.entries/package.json
-rw-r--r--  0 0      0         145 Nov 27 10:36 package/package.json

npm packするず、同じディレクトリで期埅どおりに機胜したす。

$ npm pack && tar -ztvf some-dir-1.0.0.tgz
-rw-r--r--  0 501    20        145 Nov 27 10:36 package/package.json
-rw-r--r--  0 501    20       2460 Nov 27 10:36 package/yarn.lock

Yarnは、 changelog 、 readme 、 package.jsonを含めるこずに非垞に熱心で、 node_modulesからのものも含たれおいるようです...

ダヌン@ 0.17.9を䜿甚

@torifatが1.0.2を公開したした今述べたバグを回避するためにnpmを䜿甚、それでも同じ問題

node_modulesに関するバグのために2047を開きたしたが、私の再珟は適切なtarballが公開されおいおも有効であるため、この問題では赀ニシンです。

賌読しおいる人ぞのスパムに぀いお申し蚳ありたせん、私は今やめたす

@SimenBお時間をいただきありがずうございたす。 私はバグを芋぀けたした。

これは、私が開いたばかりの2104に関連しおいるようです。 OPのむンストヌル埌のnode_modules/.bin 

$ ll node_modules/.bin
total 16
lrwxr-xr-x  1 samuelreed  staff    22B Dec  1 11:16 forever -> ../forever/bin/forever
lrwxr-xr-x  1 samuelreed  staff   109B Dec  1 11:16 nodemon -> ../../../../../Library/Caches/Yarn/npm-nodemon-1.11.0-226c562bd2a7b13d3d7518b49ad4828a3623d06c/bin/nodemon.js

2116で修正。

2116はただ統合されおいたすか コミット履歎に衚瀺されたせん。 タグ付けされたリリヌスにない堎合、少なくずもマスタヌで修正が利甚可胜になる前に、倚くの問題を閉じるのは時期尚早のようです。 たた、2116が3぀のチェックすべおに倱敗しおいるようです。 私は䜕かが足りないのですか

これは、2116を含むv0.18.0でもただ問題です。

はい、この問題が0.18.0でもただ存圚しおいるこずを確認できたす

私が芋るずころから、2116はこの問題のテストを導入する必芁がありたした test.concurrent '-productionflagはdevの䟝存関係を無芖したす' ...たたは私は間違っおいたすか

このテストでは、掚移的な䟝存関係の正しい動䜜は怜蚌されたせん。
私の堎合、問題は、prodminimatch v2.0.0ずdevuseragent v2.1.9の䟝存関係の間の共有䟝存関係lru-cacheです。 その共有䟝存関係は、prod䟝存関係で必芁な堎合でも、 --productionにむンストヌルされたせん。

@beheh minimatchがlru-cache䜿甚しおいるのがわかりたせん。本番環境にむンストヌルされおいない理由ですか

0.18.0でいく぀かのテストを行っおいたす

dep { A->B }
devDep { B }
OK
A,B are installed.
dep { A->C->D }
devDep { B->C->D }
OK
A,C,D are installed.
dep { E->A->C->D }
devDep { B->C->D }
KO
E,A,C are installed but D is missing.

これは@SimenBによっお瀺されおいるケヌス

"dependencies": {
    "entries-test": "^1.0.1"
  },
  "devDependencies": {
    "object.values": "^1.0.3"
  }

@SharpEdgeMarshallテストしおいただきありがずうございたす。 テストケヌスずしお远加したす。

@torifatはこれも再開するこずを怜蚎するかもしれたせん

@SharpEdgeMarshall以䞋を詊したしたが、機胜しおいたす。 実際の問題を理解する必芁がありたす。

screenshot 2016-12-06 21 18 44

@SimenBは、optionalDependenciesが原因で発生する可胜性もありたす。 これには別の未解決の問題がありたす。

@torifat私の再珟はただ発生したす https 

線集オプションのdepsがない堎合、 grep optional yarn.lockは1で終了したす

ただし、 define-propertiesが欠萜する代わりに、 Error: Cannot find module 'object-keys'倱敗するようになりたした。

$ yarn why object-keys
yarn why v0.18.0
[1/4] 🀔  Why do we have the module "object-keys"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
info This module exists because "object.values#define-properties" depends on it.
✹  Done in 0.09s.

今では1レベル深く凊理しおいるようですが、倱敗したす

@SimenBあなたず䞀緒に詊したした

{
  "dependencies": {
    "entries-test": "^1.0.1"
  },
  "devDependencies": {
    "object.values": "^1.0.3"
  }
}

そしお、それは私にずっおはうたく機胜しおいたす。 yarn cache cleanを実行しお、再詊行できたすか

いいえ、倱敗したす

@SimenB yarn.lockファむルを共有できたすか

$ rm -rf node_modules && rm yarn.lock && yarn cache clean && yarn && node index.js && yarn --prod && node index.js
yarn cache v0.18.0
success Cleared cache.
✹  Done in 0.07s.
yarn install v0.18.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✹  Done in 0.92s.
yarn install v0.18.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
✹  Done in 0.18s.
module.js:471
    throw err;
    ^

Error: Cannot find module 'object-keys'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/simbekkh/repos/ugh/node_modules/define-properties/index.js:3:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

私にずっお、SimenBの䟋はyarn cache clean埌でも0.18.0では機胜したせん

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


define-properties@^1.1.2:
  version "1.1.2"
  resolved "http://npm.office.crweb.it/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
  dependencies:
    foreach "^2.0.5"
    object-keys "^1.0.8"

entries-test@^1.0.1:
  version "1.0.2"
  resolved "http://npm.office.crweb.it/entries-test/-/entries-test-1.0.2.tgz#f1039aba3a2effc9c3a56b6b1180694b2789e4d5"
  dependencies:
    object.entries "^1.0.3"

es-abstract@^1.6.1:
  version "1.6.1"
  resolved "http://npm.office.crweb.it/es-abstract/-/es-abstract-1.6.1.tgz#bb8a2064120abcf928a086ea3d9043114285ec99"
  dependencies:
    es-to-primitive "^1.1.1"
    function-bind "^1.1.0"
    is-callable "^1.1.3"
    is-regex "^1.0.3"

es-to-primitive@^1.1.1:
  version "1.1.1"
  resolved "http://npm.office.crweb.it/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
  dependencies:
    is-callable "^1.1.1"
    is-date-object "^1.0.1"
    is-symbol "^1.0.1"

foreach@^2.0.5:
  version "2.0.5"
  resolved "http://npm.office.crweb.it/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"

function-bind@^1.0.2, function-bind@^1.1.0:
  version "1.1.0"
  resolved "http://npm.office.crweb.it/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"

has@^1.0.1:
  version "1.0.1"
  resolved "http://npm.office.crweb.it/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
  dependencies:
    function-bind "^1.0.2"

is-callable@^1.1.1, is-callable@^1.1.3:
  version "1.1.3"
  resolved "http://npm.office.crweb.it/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"

is-date-object@^1.0.1:
  version "1.0.1"
  resolved "http://npm.office.crweb.it/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"

is-regex@^1.0.3:
  version "1.0.3"
  resolved "http://npm.office.crweb.it/is-regex/-/is-regex-1.0.3.tgz#0d55182bddf9f2fde278220aec3a75642c908637"

is-symbol@^1.0.1:
  version "1.0.1"
  resolved "http://npm.office.crweb.it/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"

object-keys@^1.0.8:
  version "1.0.11"
  resolved "http://npm.office.crweb.it/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"

object.entries@^1.0.3:
  version "1.0.4"
  resolved "http://npm.office.crweb.it/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f"
  dependencies:
    define-properties "^1.1.2"
    es-abstract "^1.6.1"
    function-bind "^1.1.0"
    has "^1.0.1"

object.values@^1.0.3:
  version "1.0.4"
  resolved "http://npm.office.crweb.it/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a"
  dependencies:
    define-properties "^1.1.2"
    es-abstract "^1.6.1"
    function-bind "^1.1.0"
    has "^1.0.1"
$ rm -rf node_modules && rm yarn.lock && yarn cache clean && yarn && node index.js && rm -rf node_modules && rm yarn.lock && yarn cache clean && yarn --prod && node index.js
yarn cache v0.18.0
success Cleared cache.
✹  Done in 0.07s.
yarn install v0.18.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✹  Done in 0.93s.
yarn cache v0.18.0
success Cleared cache.
✹  Done in 0.07s.
yarn install v0.18.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✹  Done in 0.76s.
module.js:471
    throw err;
    ^

Error: Cannot find module 'object-keys'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/simbekkh/repos/ugh/node_modules/define-properties/index.js:3:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

ロックファむル

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


define-properties@^1.1.2:
  version "1.1.2"
  resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
  dependencies:
    foreach "^2.0.5"
    object-keys "^1.0.8"

entries-test@^1.0.1:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/entries-test/-/entries-test-1.0.2.tgz#f1039aba3a2effc9c3a56b6b1180694b2789e4d5"
  dependencies:
    object.entries "^1.0.3"

es-abstract@^1.6.1:
  version "1.6.1"
  resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.6.1.tgz#bb8a2064120abcf928a086ea3d9043114285ec99"
  dependencies:
    es-to-primitive "^1.1.1"
    function-bind "^1.1.0"
    is-callable "^1.1.3"
    is-regex "^1.0.3"

es-to-primitive@^1.1.1:
  version "1.1.1"
  resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
  dependencies:
    is-callable "^1.1.1"
    is-date-object "^1.0.1"
    is-symbol "^1.0.1"

foreach@^2.0.5:
  version "2.0.5"
  resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"

function-bind@^1.0.2, function-bind@^1.1.0:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"

has@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
  dependencies:
    function-bind "^1.0.2"

is-callable@^1.1.1, is-callable@^1.1.3:
  version "1.1.3"
  resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"

is-date-object@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"

is-regex@^1.0.3:
  version "1.0.3"
  resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.3.tgz#0d55182bddf9f2fde278220aec3a75642c908637"

is-symbol@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"

object-keys@^1.0.8:
  version "1.0.11"
  resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"

object.entries@^1.0.3:
  version "1.0.4"
  resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f"
  dependencies:
    define-properties "^1.1.2"
    es-abstract "^1.6.1"
    function-bind "^1.1.0"
    has "^1.0.1"

object.values@^1.0.3:
  version "1.0.4"
  resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a"
  dependencies:
    define-properties "^1.1.2"
    es-abstract "^1.6.1"
    function-bind "^1.1.0"
    has "^1.0.1"

@SimenBありがずう。 キャッシュに問題があったようです。 キャッシュをクリアした埌、倱敗しおいたす。 しかし、別の゚ラヌがありたす。 調査する時間をください。

ずころで、このスレッドではhttps://github.com/Mottie/Octopatcherを䜿甚するこずをお勧めし

倚くの出力ラむンで非垞に実甚的

image

スパムをやめたす

@SimenB v0.18.0倱敗したしたが、最新のmasterでは再珟できたせん。

曎新奇劙な 再び倱敗しおいたす😕

@torifatマスタヌv0.19.0では動䜜しないこずを確認できたす
rm -rf node_modules && rm yarn.lock && ../yarn/bin/yarn cache clean && ../yarn/bin/yarn && node index.js && rm -rf node_modules && rm yarn.lock && ../yarn/bin/yarn cache clean && ../yarn/bin/yarn --prod && node index.js

yarn cache v0.19.0-0
success Cleared cache.
Done in 0.58s.
yarn install v0.19.0-0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 10.18s.
yarn cache v0.19.0-0
success Cleared cache.
Done in 0.09s.
yarn install v0.19.0-0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 4.26s.
module.js:457
    throw err;
    ^

Error: Cannot find module 'object-keys'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/sharpedge/git/Utility/YarnBug/node_modules/define-properties/index.js:3:12)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

珟圚の安定した0.17.10同じ問題が発生したす䞀郚のパッケヌゞは--productionフラグでむンストヌルされたせん

curl -o- -L https://yarnpkg.com/install.sh | bash && ~/.yarn/bin/yarn install --production && rm -rf ~/.yarn

しかし、珟圚のナむトリヌビルドYarn 0.19.0-20161207.1241を詊しおみるず、必芁なすべおのパッケヌゞがアプリに正しくむンストヌルされおいたす。

wget https://yarnpkg.com/install.sh && chmod +x install.sh && ./install.sh --nightly && rm -f install.sh && ~/.yarn/bin/yarn install --production && rm -rf ~/.yarn

@SharpEdgeMarshall @SimenBは、最新のナむトリヌビルドを詊しお、問題が解決しないこずを確認できたすか。

Dockerコンテナで䜿甚 https 

@nodkz 18は

ただinstall yarn@rcが必芁だず思いたす

'dist-tags': { rc: '0.18.0', latest: '0.17.10' },

それは新しいこずです。数日前にむンストヌルするだけで0.18を取埗したした。 ずにかく、バグはただ0.18で再珟可胜です。

@nodkzReproは次の

{
  "dependencies": {
    "entries-test": "^1.0.1"
  },
  "devDependencies": {
    "object.values": "^1.0.3"
  }
}

はい、私たちのプロゞェクトでも同様の問題が発生しおいたす。

rm -rf package.json yarn.lock node_modules && npm init --yes && yarn add --dev nodemon && yarn add glob-stream && yarn --prod && node -p "require('glob-stream')"

0.18ず最新のマスタヌブランチの䞡方で倱敗したす。

同意したした。 それでも最新のもので再珟するこずができたす。

私の問題はこれず䌌おいるか同じだず思いたす。 Herokuでビルドが倱敗したすが、実皌働環境でのみ倱敗したす。 キャッシュが無効になっおいたす。

Resolving node version ^7.2.1 via semver.io...
       Downloading and installing node 7.2.1...
       Using default npm version: 3.10.10
       Resolving yarn version (latest) via semver.io...
       Downloading and installing yarn (0.18.1)...
       Installed yarn 0.18.1
-----> Restoring cache
       Skipping cache restore (disabled by config)
-----> Building dependencies
       Installing node modules (yarn)
       yarn install v0.18.1
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       warning [email protected]: The platform "linux" is incompatible with this module.
       info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       [4/4] Building fresh packages...
       error /tmp/build_0e4ff736ad0f25dc816a47543687fefc/bbb7b6e751dde291f65dea175f41a26862eef28f/node_modules/bcrypt: Command failed.
       Exit code: 1
       Command: sh
       Arguments: -c node-pre-gyp install --fallback-to-build
       Directory: /tmp/build_0e4ff736ad0f25dc816a47543687fefc/bbb7b6e751dde291f65dea175f41a26862eef28f/node_modules/bcrypt
       Output:
       module.js:472
       throw err;
       ^

       Error: Cannot find module 'abbrev'
       at Function.Module._resolveFilename (module.js:470:15)
       at Function.Module._load (module.js:418:25)
       at Module.require (module.js:498:17)
       at require (internal/module.js:20:19)
       at Object.<anonymous> (/tmp/build_0e4ff736ad0f25dc816a47543687fefc/bbb7b6e751dde291f65dea175f41a26862eef28f/node_modules/nopt/lib/nopt.js:10:14)
       at Module._compile (module.js:571:32)
       at Object.Module._extensions..js (module.js:580:10)
       at Module.load (module.js:488:32)
       at tryModuleLoad (module.js:447:12)
       at Function.Module._load (module.js:439:3)
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-----> Build failed

私もこの問題を抱えおいたす。 yarn install --productionが適切な䟝存関係を正しくむンストヌルしないため、珟時点ではただyarn installを本番環境に䜿甚しおいたす。

Herokuビルドパックでyarn install --productionにハヌドコヌドされおいるため、それができないのではないかず思いたすhttps://github.com/heroku/heroku-buildpack-nodejs/issues/337を参照

@adamreisnz申し蚳ありたせんが、私はあなたの問題ではなく、元の問題に぀いお蚀及しおいたした。

この問題の回避策ずしお、この問題が修正されるたで、今のずころすべおのdevDependenciesをdependenciesに配眮するこずをお勧めしたす。

@dashmugああ、問題ありたせん。

ずにかく、私は、ハッキヌな゜リュヌションをいじくり回すよりも、Yarnがより安定するたで、Herokuでnpmを䜿甚するこずを奜みたす。 yarn.lockを.gitignoreので、レポ/ herokuにアップロヌドされたせん。 このように、Yarnをロヌカルで䜿甚するこずはできたすが、Herokuのビルドには圱響したせん。

@adamreisnzそれはyarnを䜿うずいうあなたの目的を打ち砎りたすね。

@dashmug少なくずも、私たちにずっおはそうではありたせん。 パッケヌゞバヌゞョンを所定の䜍眮にロックするために䜿甚しおいたせん。 非垞に最新の䟝存関係があり、「自分のマシンで動䜜する」ずいう問題はありたせん。 npmを介しおyarnに移行する䞻な理由は、速床のためでした。䟝存関係が倚い耇雑なアプリの堎合、 npm install 5分からyarnの22秒になりたした。

糞が䞍安定である限り、開発のためにロヌカルで糞を䜿甚でき、むンストヌルが高速である限り、Herokuでのビルドプロセスは少し遅くなりたす:)

Yarnは、npmのほずんどのドロップむン代替品ずしお宣䌝されおいたす。 ただし、このような問題が発生し、ただ解決されおいないため、そのたた䜿甚するこずはできたせん。 したがっお、珟時点では远加のツヌルず芋なしおいたす。これは、ある目的には圹立ちたすが、別の目的にはただありたせん。 私はそれがうたくいくこずは間違いありたせん:)

これは0.18.1で修正されたようです。

Herokuは倱敗したずきに0.18.1を䜿甚しおいたため、ただ修正されおいたせん。

この問題は0.18.1で修正されたした。

私の以前の再珟は0.18.1で修正されおいたす🎉

明日は本物のアプリでやっおみたす

0.18.1で問題が修正されたした。 私は幞せなキャンピングカヌです🎉

以前は倱敗しおいた重芁なアプリで0.18.1を詊したしたが、珟圚は機胜しおいるようです。 🎉

もうすぐやっおみようず思いたす:)

申し蚳ありたせんが、ただ0.18.1では動䜜したせん。

-----> Node.js app detected
-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_ENV=production
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  ^7.2.1
       engines.npm (package.json):   unspecified (use default)

       Resolving node version ^7.2.1 via semver.io...
       Downloading and installing node 7.2.1...
       Using default npm version: 3.10.10
       Resolving yarn version (latest) via semver.io...
       Downloading and installing yarn (0.18.1)...
       Installed yarn 0.18.1
-----> Restoring cache
       Loading 2 from cacheDirectories (default):
       - node_modules
       - bower_components (not cached - skipping)
-----> Building dependencies
       Installing node modules (yarn)
       yarn install v0.18.1
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       warning [email protected]: The platform "linux" is incompatible with this module.
       info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       [4/4] Building fresh packages...
       error /tmp/build_c86802dccae94b3fb074d3b88f3f63f2/9512deeed23c0eca48d68fb2c8850a28f76692ea/node_modules/bcrypt: Command failed.
       Exit code: 1
       Command: sh
       Arguments: -c node-pre-gyp install --fallback-to-build
       Directory: /tmp/build_c86802dccae94b3fb074d3b88f3f63f2/9512deeed23c0eca48d68fb2c8850a28f76692ea/node_modules/bcrypt
       Output:
       module.js:472
       throw err;
       ^

       Error: Cannot find module 'abbrev'
       at Function.Module._resolveFilename (module.js:470:15)
       at Function.Module._load (module.js:418:25)
       at Module.require (module.js:498:17)
       at require (internal/module.js:20:19)
       at Object.<anonymous> (/tmp/build_c86802dccae94b3fb074d3b88f3f63f2/9512deeed23c0eca48d68fb2c8850a28f76692ea/node_modules/nopt/lib/nopt.js:10:14)
       at Module._compile (module.js:571:32)
       at Object.Module._extensions..js (module.js:580:10)
       at Module.load (module.js:488:32)
       at tryModuleLoad (module.js:447:12)
       at Function.Module._load (module.js:439:3)
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       Some possible problems:

       - A module may be missing from 'dependencies' in package.json
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies

       - This module may be specified in 'devDependencies' instead of 'dependencies'
       https://devcenter.heroku.com/articles/nodejs-support#devdependencies

       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed

NODE_MODULES_CACHE=false蚭定しおも圹に立ちたせん

䟝存関係ツリヌは次のずおりです。

├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       └─┬ [email protected]
│         └── [email protected] 
├─┬ [email protected]
│ └─┬ @google-cloud/[email protected]
│   └─┬ @google-cloud/[email protected]
│     └─┬ [email protected]
│       └─┬ [email protected]
│         └─┬ [email protected]
│           └── [email protected] 
└─┬ [email protected]
  └── [email protected] 

問題はgoogle-cloud介した深い䟝存関係だず思いたす。 これは本番モゞュヌルであり、 bable-cliずinstanbulはどちらも開発者専甚です。

さらに、 yarn why abbrevを䜿甚するず、 google-cloudずbabel-cli芪の扶逊家族を取埗できたせん。

yarn why v0.18.1
[1/4] 🀔  Why do we have the module "abbrev"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
info Reasons this module exists
   - "istanbul" depends on it
   - "istanbul#nopt" depends on it

@ jkrems 、 @ SimonBそのための新しい問題を提起したせんか

istanbul#noptも、 why出力で間違っおいるように芋えたす。
私は今仕事をする方法がありたす、それから実際のアプリでテストしたす

@SimenBありがずうございたす

線集実際にここでそれは念のためです、私は今寝る぀もりです。

"dependencies": {
    "bcrypt": "^1.0.1",
    "bluebird": "^3.4.6",
    "body-parser": "^1.15.2",
    "chalk": "^1.1.3",
    "compression": "^1.6.2",
    "cookie-parser": "^1.4.3",
    "cors": "^2.8.1",
    "express": "^4.14.0",
    "glob": "^7.1.1",
    "google-cloud": "^0.45.1",
    "handlebars": "^4.0.6",
    "html-pdf": "^2.1.0",
    "http-as-promised": "^1.1.0",
    "meanie-express-error-handling": "git+https://github.com/meanie/express-error-handling#2.0.0",
    "meanie-express-github-service": "^2.0.2",
    "meanie-express-jwt-service": "^1.0.2",
    "meanie-express-raven-service": "^1.0.1",
    "meanie-mail-composer": "^1.2.0",
    "meanie-mongoose-only-id": "^1.0.1",
    "meanie-mongoose-set-properties": "^1.0.1",
    "meanie-mongoose-to-json": "^1.1.0",
    "meanie-multer-mime-types-filter": "^1.0.1",
    "meanie-passport-refresh-strategy": "^1.1.2",
    "moment": "^2.17.1",
    "mongoose": "^4.7.3",
    "morgan": "^1.7.0",
    "multer": "^1.1.0",
    "passport": "^0.3.2",
    "passport-http-bearer": "^1.0.1",
    "passport-local": "^1.0.0",
    "phantomjs-prebuilt": "2.1.14",
    "sendgrid": "^4.7.1",
    "sendgrid-mailer": "^1.0.7",
    "socket.io": "^1.7.2",
    "yargs": "^6.5.0"
  },
  "devDependencies": {
    "babel-cli": "^6.16.0",
    "babel-preset-es2015": "^6.18.0",
    "chai": "^3.5.0",
    "chai-as-promised": "^6.0.0",
    "dirty-chai": "^1.2.2",
    "eslint": "^3.12.1",
    "express-simulate-latency": "0.0.2",
    "istanbul": "^1.0.0-alpha.2",
    "mocha": "^3.2.0",
    "mocha-clean": "^1.0.0",
    "nodemon": "^1.11.0",
    "sinon": "^1.17.6",
    "sinon-as-promised": "^4.0.0",
    "sinon-mongoose": "^1.3.0"
  }

これは、動䜜䞭のアプリではただ倱敗したす。 ダヌンは深い道をたどるこずができないようです。 これがnpm ls entities埌のyarn --prod

$ npm ls entities
[email protected] /Users/simbekkh/repos/frontpage
└─┬ @finn-no/[email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ [email protected]
        └─┬ [email protected]
          └─┬ [email protected]
            └── UNMET DEPENDENCY entities@~1.1.1

npm ERR! missing: entities@~1.1.1, required by [email protected]

@adamreisnzず同じように、 yarn whyは正しいツリヌを取埗したせん。

$ yarn why entities
yarn why v0.18.1
[1/4] 🀔  Why do we have the module "entities"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
info Reasons this module exists
   - "cheerio" depends on it
   - "cheerio#htmlparser2" depends on it
info Disk size without dependencies: "108kB"
info Disk size with unique dependencies: "108kB"
info Disk size with transitive dependencies: "108kB"
info Amount of shared dependencies: 0
✹  Done in 0.40s.

istanbulnoptも、why出力で間違っおいるように芋えたす。

そうです、それがこの問題の栞心である可胜性が高いようです。 noptは、 google-cloudやbabel-cliではなく、 istanbulパッケヌゞの䞀郚であるず考えられおいるようです。そのため、本番環境にむンストヌルされおいない可胜性がありたす。 istanbulは補品の䟝存関係ではないため、環境。

みなさん、この問題がしばらく発生しおいるこずをお詫び申し䞊げたす。
私はこの問題を自分自身に割り圓お、珟圚は優先床が高いので、䌑暇䞭に修正しようずしたす。
分離された砎壊テストたたは修正理想的にはを䌎うヘルプずPRは倧歓迎です。

gulp-imageminのオプションの䟝存関係の䟝存関係であるlib bl prodenvでも同じ問題がありたす😕

[~/Workspaces/my-project 12:05:33] NODE_ENV=production yarn
yarn install v0.18.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning algoliasearch > [email protected]: Just use Array.isArray directly
warning gulp-file > through2 > xtend > [email protected]:
warning raven > [email protected]: use uuid module instead
warning wiredep > bower-config > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
warning chromedriver > [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
warning mversion > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning wiredep > glob > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning webdriverio > request > [email protected]: use uuid module instead
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
warning sprity-lwip > lwip > decree > [email protected]: This package is discontinued. Use lodash@^4.0.0.
[2/4] 🚚  Fetching packages...
warning [email protected]: The engine "ender" appears to be invalid.
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/7] ⠂ fsevents: GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v51-darwi
[2/7] ⠂ gifsicle
[3/7] ⠂ jpegtran-bin
[4/7] ⠂ optipng-bin
error /Users/fdubost/Workspaces/my-project/node_modules/gifsicle: Command failed.
Exit code: 1
Command: sh
Arguments: -c node lib/install.js
Directory: /Users/fdubost/Workspaces/my-project/node_modules/gifsicle
Output:
module.js:474
    throw err;
    ^

Error: Cannot find module 'bl'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/fdubost/Workspaces/my-project/node_modules/tar-stream/extract.js:2:10)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)

あなたの助けをありがずう😊

package.jsonにblを手動で远加するず機胜したす...

これに関するニュヌスはありたすか

ただ、Yarnの巻き䞊げおよび解決アルゎリズムhttps://github.com/yarnpkg/yarn/pull/2419ずは無関係にnode_modules構造を怜蚌するアドホックcommonJSチェッカヌを構築しおい
このバグで説明されおいるすべおのケヌスをキャッチし、将来のリグレッションから保護するこずができたす。

@kittensは、ここで䜕が起こっおいるのかを調べおいたす。
バグは些现なこずではないので、远加の掞察は倧歓迎です

了解したした。最新のトランクですべおの再珟を収集したす。
最初のコメントの䟋はもう再珟されず、 yarn check --verify-treeは合栌です

ええ、その再珟は0.18.1で修正されたした。

2぀のアむデア

私があなたず共有できる解決策が起こっおいるログはありたすか

さらに、職堎でそれを再珟するロックファむルを提䟛するこずはできたすが、プラむベヌト郚門のためにむンストヌルするこずはできたせん。 パッケヌゞのフェッチをいじっおスキップし、ツリヌをいじくりたわすこずができるかもしれたせんか

@SimenB 、

その堎合は、次のこずを詊すこずができたす。

yarn install --production --verbose
yarn check --production --verify-tree

最新のマスタヌブランチ付き。
ログを公開したくない堎合は、 bestander @ gmail.comたでメッセヌゞを送っお

ええ、0.18.1はただ壊れおいお、0.19たたはマスタヌをテストしおいたせん。 それでも再珟される堎合垌望しない、ログを非公開で送信したす

タむトルの問題が解決したので、このタスクを閉じたしょう。
ただ再確認しおいない未解決のものが2぀ありたす。2263ず2141にコメントするか、ケヌス甚に新しいものを䜜成しおCCしおください。

2allむンストヌルが正しくないずコメントする堎合は、他の人がそれを再珟できるようにpackage.jsonを含めおください。
さらなるステップを䜜り、玠晎らしいREPROスクリプトを提出するための@jkremsに賞賛https://github.com/yarnpkg/yarn/issues/761#issuecomment -265823529

@bestander https://github.com/yarnpkg/yarn/issues/761#issuecomment -268130124も再確認したしたか

@ adamreisnz 、package.jsonをもう䞀床共有できたすか

https://github.com/yarnpkg/yarn/issues/761#issuecomment-268130124は別の問題です。

それはyarn install --production倱敗したす。

この問題は、 yarn install --production正垞に終了するこずですが、正しく機胜しおいたせん。

@bestanderその䞋のコメントで共有したした、 https //github.com/yarnpkg/yarn/issues/761#issuecomment -268201708、也杯

それでも私にずっおはマスタヌc98df16bで倱敗したす...

yarn check --verify-treeはスロヌしたすが、それは有望です。 しかし、それらの倚くは開発郚門です。

yarn check v0.20.0-0
error "babel-preset-es2015" not installed
error "browserify-middleware" not installed
error "cheerio" not installed
error "codeceptjs" not installed
error "del-cli" not installed
error "eslint" not installed
error "eslint-config-finn" not installed
error "espower-loader" not installed
error "hashmark" not installed
error "interfake" not installed
error "nightmare" not installed
error "nightmare-upload" not installed
error "nock" not installed
error "nodemon" not installed
error "nyc" not installed
error "power-assert" not installed
error "sinon" not installed
error "supertest" not installed
error "uglifyify" not installed
error "@finn-no/express-base#nunjucks#chokidar#anymatch" not installed
error "@finn-no/express-base#unleash-client#request#json-stringify-safe" not installed
error "@finn-no/express-base#pretty-error#renderkid#css-select#domutils#dom-serializer#entities" not installed
error Found 22 errors.

アプリを実行するず、䞀臎するものが芋぀からないず倱敗したす。

npm lsは、他の䞍足しおいる郚門を瀺しおいたす。これはより理にかなっおいたす

npm ERR! extraneous: [email protected] /Users/simbekkh/repos/frontpage/node_modules/node-pre-gyp
npm ERR! missing: anymatch@^1.3.0, required by [email protected]
npm ERR! missing: entities@~1.1.1, required by [email protected]
npm ERR! missing: json-stringify-safe@~5.0.1, required by [email protected]

そしお、これが問題の芳察/原因でした https 

そうです、それがこの問題の栞心である可胜性が高いようです。 noptはgoogle-cloudやbabel-cliではなくistanbulパッケヌゞの䞀郚であるず考えられおいるようです。これが、istanbulが本番環境に䟝存しおいないため、本番環境にむンストヌルされおいない理由かもしれたせん。

ああ、すみたせん、 @ SimonB

yarn check --prodution --verify-tree

コメントを線集したす

yarn check --verify-tree --productionを実行するず、良奜な出力が埗られたす npm lsず䞀臎したす。

yarn check v0.20.0-0
error "@finn-no/express-base#nunjucks#chokidar#anymatch" not installed
error "@finn-no/express-base#unleash-client#request#json-stringify-safe" not installed
error "@finn-no/express-base#pretty-error#renderkid#css-select#domutils#dom-serializer#entities" not installed
error Found 3 errors.

@bestander package.json、yarn.lock、および詳现なむンストヌルログをメヌルで送信したす😄

@dashmugその問題の新しいチケットを䜜成したすか 本番甚ではありたすが誀った䟝存関係がむンストヌルされおいるずいう問題がただあるので、このチケットに関連しおいるず思いたす。

@bestanderメヌルが送信されたした。
@finn-no/express-baseは公開されおいたせんが、出力内の他の3぀のパッケヌゞは公開されおいるため、公開パッケヌゞのみで耇補できるこずを願っおいたす。

新しい号を開く必芁がありたすか

@adamreisnz 、新しい問題を䜜成しお
再珟はできたすが、タむトルずは別問題です

関連しおいたす。 おそらく同じ原因です。 ただ違う症状。 タむトルの内容ず党く同じではないので、別の問題ずしお考えたす。

@SimenB 、ありがずう、芋おみたす

倧䞈倫だよ。

@bestander出力に3぀だけが含たれおいるパッケヌゞを䜜成しおも倱敗するず、マスタヌでパブリックデップだけで再珟可胜になりたす。 最小限の耇補ではありたせんが、それでも

{
  "name": "app",
  "version": "1.0.0",
  "dependencies": {
    "brakes": "^2.5.1",
    "compression": "^1.6.2",
    "envalid": "^2.4.0",
    "express": "^4.14.0",
    "object.entries": "^1.0.4",
    "prom-client": "^7.0.0",
    "response-time": "^2.3.2",
    "spaden": "^7.13.1",
    "yarn-issue-repro-package": "^1.0.0"
  },
  "devDependencies": {
    "babel-preset-es2015": "^6.18.0",
    "browserify": "^13.1.1",
    "browserify-middleware": "^7.1.0",
    "cheerio": "^0.22.0",
    "codeceptjs": "^0.4.13",
    "del-cli": "^0.2.1",
    "eslint": "^3.12.2",
    "eslint-config-finn": "^1.0.1",
    "espower-loader": "^1.0.1",
    "hashmark": "^4.1.0",
    "interfake": "^1.19.0",
    "mocha": "^3.2.0",
    "nightmare": "^2.9.0",
    "nightmare-upload": "^0.1.1",
    "nock": "^9.0.2",
    "nodemon": "^1.11.0",
    "nyc": "^10.0.0",
    "power-assert": "^1.4.1",
    "sinon": "^1.17.6",
    "supertest": "^2.0.1",
    "uglify-js": "^2.7.5",
    "uglifyify": "^3.0.4"
  }
}

package.jsonのyarn-issue-repro-package

{
  "name": "yarn-issue-repro-package",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "nunjucks": "^2.5.2",
    "pretty-error": "^2.0.2",
    "unleash-client": "^1.0.0-beta.7"
  }
}

興味深いこずに、3぀ではなく4぀の゚ラヌが発生したす...

$ yarn check v0.20.0-0                                                                                                   │├─ [email protected]
error "yarn-issue-repro-package#nunjucks#chokidar#anymatch" not installed                                              │└─ [email protected]
error "yarn-issue-repro-package#unleash-client#request#json-stringify-safe" not installed                              │✹  Done in 2.65s.
error "yarn-issue-repro-package#nunjucks#yargs#string-width#code-point-at" not installed                               │ ~/repos/yarn-issue-repro-package  vim package.json
error "yarn-issue-repro-package#pretty-error#renderkid#css-select#domutils#dom-serializer#entities" not installed      │ ~/repos/yarn-issue-repro-package  npm publish
error Found 4 errors.

これが同じ問題かどうかはわかりたせんが、出力は次のずおりです0.19.1でテスト枈み

むンストヌルの問題の根本的な原因を芋぀けたず思いたす。
パッケヌゞのむンストヌルの倱敗は、次のpackage.jsonで再珟できたす。

{ "dependencies": {
    "bcrypt": "^1.0.1",
    "gamepad": "1.4.2"
  },
  "devDependencies": {
     "istanbul": "^1.0.0-alpha.2"
  }
}

そしお、コマンド

rm -rf node_modules yarn.lock
yarn install
rm -rf node_modules
yarn install --production
npm ls abbrev

この構成では、 abbrevはむンストヌルされたせん。

abbrevはistanbulずnoptによっお䜿甚されたす yarn why abbrevからわかるように。 noptはistanbulずnode-pre-gypによっお䜿甚されたすこれはbcryptずgamepadによっお䜿甚されたす。

パッケヌゞホむスタヌでabbrevを重耇排陀する堎合、次のコヌドを䜿甚しお、ホむストレコヌドの新しいisIgnored関数を決定したす。

          // switch to non ignored if earlier deduped version was ignored
          if (existing.isIgnored() && !info.isIgnored()) {
            existing.isIgnored = info.isIgnored;
          }

abbrevは、凊理される最初の巻き䞊げレコヌドの1぀です。 その時点で、既存のレコヌドはistanbul#abbrev  istanbulが無芖されるため無芖されたすであり、重耇レコヌドはistanbul#nopt#abbrev 。これも、同じ理由でその時点で無芖されたす。 。

䞡方のレコヌドがその時点で無芖されるため、無芖関数は想定どおりに調敎されたせん。これは、 node-pre-gypによる䟝存関係のため、 noptが埌の重耇排陀で無芖されなくなるためです。 䞡方のレコヌドの無芖ステヌタスはい぀でも倉曎される可胜性があるため、新しい無芖関数はそれらを混合する必芁がありたす。

実際、これらの行を次のように眮き換えるず、むンストヌルの問題はなくなりたす。

          // switch to non ignored if earlier deduped version was ignored
          if (existing.isIgnored()) {
            if (info.isIgnored()) {
              // both are ignored now, but any one could become non ignored later on.
              let oldIsIgnored = existing.isIgnored;
              existing.isIgnored = () => oldIsIgnored() && info.isIgnored();
            } else {
              existing.isIgnored = info.isIgnored;
            }
          }

@blexrob 、玠晎らしい発芋
PRを送っおいただけたせんか
Integration.jsには、「-productionを䜿甚しおむンストヌルするずきに䟝存関係が倱われないようにする」ずいう無効なテストがありたす。これは今すぐ修正する必芁がありたす。

@bestander 、テストしたばかり

d#es5-ext -> es6-symbol#es5-ext -> es6-set#es5-ext -> es6-iterator#es5-ext -> es6-map#es5-ext -> es5-ext#es6-iterator -> es6-set#es6-iterator -> es6-weak-map#es6-iterator -> event-emitter#es5-ext -> d#es5-ext

だから、玠朎な再垰呌び出しアプロヌチが出おいたす...

ええ、少し調敎が必芁だず思いたすが、アむデアは正しいようです

ダヌン0.27.5-1のphantomjs-prebuiltモゞュヌル䟝存関係の䟝存性ずしおでこのような問題が発生したす。
だから今私はyarn install --production前にダミヌのyarn add phantomjs-prebuilt yarn install --productionたす。

残念ながら、これはYarn1.3.2ではただ問題のようです。
Yarn 1.3.2を䜿甚するず、Netlifyでのビルドが倱敗したすが、Yarn0.18.2では成功したす。
cannot find module 'are-we-there-yet'で、本番フラグのみのビルド゚ラヌ。

@adamreisnz 、このスレッドは倧きすぎおすべおの問題を远跡できたせん。
reproスクリプトで新しいものを育おおもらえたすか

@bestander完了、ありがずう。

それでも動䜜せず、 jqをむンストヌルしたくない人は

$ python -c "import json; p = json.loads(open('package.json').read()); del p['devDependencies']; open('package.json', 'w').write(json.dumps(p, indent=2));"

私はlernaモノレポの糞1.17.3ずノヌドv10.16.2を䜿甚しおいたす。 ただ同じ問題に盎面しおいたす。

私も確認できたす。
䟝存関係はたくさんありたすが、 yarn install --productionを䜿甚するず、2぀のモゞュヌルしかむンストヌルされたせん。
ただし、私は@hannadrehmanに䌌たLerna monorepoを䜿甚しおYarnワヌクスペヌスがあり

糞バヌゞョン1.22.0
ノヌドv12.16.1

ただし、 npm install --productionは完党に機胜したす。

@hannadrehmanは、問題のプロゞェクトがあなたのモノレポのパッケヌゞですか

@ TAnas0ず同じ問題

このペヌゞは圹に立ちたしたか
0 / 5 - 0 評䟡