Berry: [Bug] cypress fails install with node-modules linker

Created on 25 Jan 2020  ·  15Comments  ·  Source: yarnpkg/berry

  • [x] I'd be willing to implement a fix

Describe the bug

Running yarn install in a project depending on cypress and using nodeLinker: "node-modules" fails with ➤ YN0009: │ cypress@npm:3.8.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/logfile-394W9pExI466nwo.log).

And it also hangs on the first install but that is already reported in https://github.com/yarnpkg/berry/issues/751

Apparently yarn thinks cypress requires an undeclared dependency minimist (used in postinstall) though this dependency is declared.


/tmp/logfile-394W9pExI466nwo.log

# This file contains the result of Yarn building a package (cypress@npm:3.8.2)
# Script name: postinstall

/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:23819
    throw firstError;
    ^

Error: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies

Required package: minimist (via "minimist")
Required by: /home/eps1lon/Development/src/js/dom-accessibility-api/node_modules/cypress/

Require stack:
- /home/eps1lon/Development/src/js/dom-accessibility-api/node_modules/cypress/index.js
    at Object.makeError (/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:15564:24)
    at resolveToUnqualified (/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:24420:35)
    at resolveRequest (/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:24504:27)
    at Object.resolveRequest (/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:24572:26)
    at Function.module_1.Module._resolveFilename (/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:23802:34)
    at Function.module_1.Module._load (/home/eps1lon/Development/src/js/dom-accessibility-api/.pnp.js:23687:40)
    at Module.require (internal/modules/cjs/loader.js:838:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/eps1lon/Development/src/js/dom-accessibility-api/node_modules/cypress/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:945:30) {
  code: 'MODULE_NOT_FOUND',
  pnpCode: 'UNDECLARED_DEPENDENCY',
  data: {
    request: 'minimist',
    issuer: '/home/eps1lon/Development/src/js/dom-accessibility-api/node_modules/cypress/',
    dependencyName: 'minimist'
  },
  requireStack: [
    '/home/eps1lon/Development/src/js/dom-accessibility-api/node_modules/cypress/index.js'
  ]
}

To Reproduce

``js repro await yarn(init); await yarn(add,cypress); await yarn(config,set,nodeLinker,node-modules`);

await expect(yarn(install)).resolves.toBeTruthy();
```

Environment if relevant (please complete the following information):

  • OS: Ubuntu 18.04.3 LTS
  • Node version: v12.11.1
  • Yarn version: 2.0.0-rc.27

Additional context

Switching to node_modules because of https://github.com/prettier/prettier-vscode/issues/1221

bug node-modules unreproducible

Most helpful comment

That should do it. Even includes the full log. Very nice.

Error: Command failed: /home/eps1lon/.nvm/versions/node/v10.16.3/bin/node /home/eps1lon/Development/src/js/forks/berry/scripts/actions/../run-yarn.js install

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0.03s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.17s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:3.8.3 must be built because it never did before or the last one failed
➤ YN0000: │ cypress@npm:3.8.3 STDERR /tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15510
➤ YN0000: │ cypress@npm:3.8.3 STDERR     throw firstError;
➤ YN0000: │ cypress@npm:3.8.3 STDERR     ^
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Error: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required package: minimist (via "minimist")
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required by: /tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Require stack:
➤ YN0000: │ cypress@npm:3.8.3 STDERR - /tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/index.js
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.makeError (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:7255:24)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveToUnqualified (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16111:35)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveRequest (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16195:27)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.resolveRequest.maybeLog [as resolveRequest] (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16263:26)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._resolveFilename (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15493:34)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._load (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15378:40)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module.require (internal/modules/cjs/loader.js:692:17)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at require (internal/modules/cjs/helpers.js:25:18)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.<anonymous> (/tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/index.js:3:16)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:778:30)
➤ YN0009: │ cypress@npm:3.8.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/logfile-1722786XLXW0Mh6G2.log)
➤ YN0000: └ Completed in 7.58s
➤ YN0000: Failed with errors in 7.8s

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)⏎   

All 15 comments

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js add cypress

Usage Error: No project found in /tmp/tmp-27K6sWeVR59bCK

$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [--prefer-dev] [-i,--interactive] [--cached] ...

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js yarn config set nodeLinker "node-modules"

Usage Error: Couldn't find a script named "yarn".

$ yarn run <scriptName> ...

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js install

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0.06s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.46s
➤ YN0000: ┌ Link step
➤ YN0012: │ cypress@npm:3.8.3 isn't supported by any available linker
➤ YN0000: └ Completed in 0.02s
➤ YN0000: Failed with errors in 0.55s

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

Discovered https://next.yarnpkg.com/advanced/sherlock#can-i-develop-my-reproduction-offline. Give me a sec :)

That should do it. Even includes the full log. Very nice.

Error: Command failed: /home/eps1lon/.nvm/versions/node/v10.16.3/bin/node /home/eps1lon/Development/src/js/forks/berry/scripts/actions/../run-yarn.js install

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0.03s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.17s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:3.8.3 must be built because it never did before or the last one failed
➤ YN0000: │ cypress@npm:3.8.3 STDERR /tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15510
➤ YN0000: │ cypress@npm:3.8.3 STDERR     throw firstError;
➤ YN0000: │ cypress@npm:3.8.3 STDERR     ^
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Error: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required package: minimist (via "minimist")
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required by: /tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Require stack:
➤ YN0000: │ cypress@npm:3.8.3 STDERR - /tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/index.js
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.makeError (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:7255:24)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveToUnqualified (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16111:35)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveRequest (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16195:27)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.resolveRequest.maybeLog [as resolveRequest] (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16263:26)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._resolveFilename (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15493:34)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._load (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15378:40)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module.require (internal/modules/cjs/loader.js:692:17)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at require (internal/modules/cjs/helpers.js:25:18)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.<anonymous> (/tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/index.js:3:16)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:778:30)
➤ YN0009: │ cypress@npm:3.8.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/logfile-1722786XLXW0Mh6G2.log)
➤ YN0000: └ Completed in 7.58s
➤ YN0000: Failed with errors in 7.8s

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)⏎   

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js install

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0.05s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.42s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:3.8.3 must be built because it never did before or the last one failed
➤ YN0000: │ cypress@npm:3.8.3 STDERR /tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:15510
➤ YN0000: │ cypress@npm:3.8.3 STDERR     throw firstError;
➤ YN0000: │ cypress@npm:3.8.3 STDERR     ^
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Error: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required package: minimist (via "minimist")
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required by: /tmp/tmp-27Z1GS1dhNdQ0G/node_modules/cypress/
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Require stack:
➤ YN0000: │ cypress@npm:3.8.3 STDERR - /tmp/tmp-27Z1GS1dhNdQ0G/node_modules/cypress/index.js
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.makeError (/tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:7255:24)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveToUnqualified (/tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:16111:35)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveRequest (/tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:16195:27)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.resolveRequest (/tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:16263:26)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._resolveFilename (/tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:15493:34)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._load (/tmp/tmp-27Z1GS1dhNdQ0G/.pnp.js:15378:40)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module.require (internal/modules/cjs/loader.js:852:19)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at require (internal/modules/cjs/helpers.js:74:18)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.<anonymous> (/tmp/tmp-27Z1GS1dhNdQ0G/node_modules/cypress/index.js:3:16)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:959:30) {
➤ YN0000: │ cypress@npm:3.8.3 STDERR   code: 'MODULE_NOT_FOUND',
➤ YN0000: │ cypress@npm:3.8.3 STDERR   pnpCode: 'UNDECLARED_DEPENDENCY',
➤ YN0000: │ cypress@npm:3.8.3 STDERR   data: {
➤ YN0000: │ cypress@npm:3.8.3 STDERR     request: 'minimist',
➤ YN0000: │ cypress@npm:3.8.3 STDERR     issuer: '/tmp/tmp-27Z1GS1dhNdQ0G/node_modules/cypress/',
➤ YN0000: │ cypress@npm:3.8.3 STDERR     dependencyName: 'minimist'
➤ YN0000: │ cypress@npm:3.8.3 STDERR   },
➤ YN0000: │ cypress@npm:3.8.3 STDERR   requireStack: [ '/tmp/tmp-27Z1GS1dhNdQ0G/node_modules/cypress/index.js' ]
➤ YN0000: │ cypress@npm:3.8.3 STDERR }
➤ YN0009: │ cypress@npm:3.8.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/logfile-83hfiFSdQZKEXz.log)
➤ YN0000: └ Completed in 11.61s
➤ YN0000: Failed with errors in 12.09s

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

Ok the arrange and act part I got. No idea how the assertion should look to be considered "reproducible".

Either way I don't have more time. Hope this is sufficient.

We couldn't reproduce your issue (all the assertions passed on master).

We couldn't reproduce your issue (all the assertions passed on master).

@eps1lon Actually I cannot reproduce this:

$ yarn set version berry
➤ YN0000: Found matching release with rc
➤ YN0000: Downloading https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-rc.js
➤ YN0000: Done in 2.91s
$ yarn
yarn
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0.04s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.17s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:3.8.2 must be built because it never did before or the last one failed
➤ YN0000: └ Completed in 5.54s
➤ YN0000: Done in 5.75s

P.S. same with [email protected]:

$ yarn add cypress
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 4.27s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.63s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:3.8.3 must be built because it never did before or the last one failed
➤ YN0000: └ Completed in 6.3s
➤ YN0000: Done in 11.22s

@eps1lon an await was missing, hence the passing yarnbot even though it should have fail.
@larixer try running yarn sherlock 754 in the repo, it should throw the error.

This issue reproduces on master:

Error: expect(received).resolves.toBeTruthy()

Received promise rejected instead of resolved
Rejected to value: [Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js install

➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0.05s
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0.32s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:3.8.3 must be built because it never did before or the last one failed
➤ YN0000: │ cypress@npm:3.8.3 STDERR /tmp/tmp-277gRdCc7fOJGM/.pnp.js:15510
➤ YN0000: │ cypress@npm:3.8.3 STDERR     throw firstError;
➤ YN0000: │ cypress@npm:3.8.3 STDERR     ^
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Error: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required package: minimist (via "minimist")
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required by: /tmp/tmp-277gRdCc7fOJGM/node_modules/cypress/
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Require stack:
➤ YN0000: │ cypress@npm:3.8.3 STDERR - /tmp/tmp-277gRdCc7fOJGM/node_modules/cypress/index.js
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.makeError (/tmp/tmp-277gRdCc7fOJGM/.pnp.js:7255:24)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveToUnqualified (/tmp/tmp-277gRdCc7fOJGM/.pnp.js:16111:35)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveRequest (/tmp/tmp-277gRdCc7fOJGM/.pnp.js:16195:27)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.resolveRequest (/tmp/tmp-277gRdCc7fOJGM/.pnp.js:16263:26)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._resolveFilename (/tmp/tmp-277gRdCc7fOJGM/.pnp.js:15493:34)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._load (/tmp/tmp-277gRdCc7fOJGM/.pnp.js:15378:40)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module.require (internal/modules/cjs/loader.js:852:19)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at require (internal/modules/cjs/helpers.js:74:18)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.<anonymous> (/tmp/tmp-277gRdCc7fOJGM/node_modules/cypress/index.js:3:16)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:959:30) {
➤ YN0000: │ cypress@npm:3.8.3 STDERR   code: 'MODULE_NOT_FOUND',
➤ YN0000: │ cypress@npm:3.8.3 STDERR   pnpCode: 'UNDECLARED_DEPENDENCY',
➤ YN0000: │ cypress@npm:3.8.3 STDERR   data: {
➤ YN0000: │ cypress@npm:3.8.3 STDERR     request: 'minimist',
➤ YN0000: │ cypress@npm:3.8.3 STDERR     issuer: '/tmp/tmp-277gRdCc7fOJGM/node_modules/cypress/',
➤ YN0000: │ cypress@npm:3.8.3 STDERR     dependencyName: 'minimist'
➤ YN0000: │ cypress@npm:3.8.3 STDERR   },
➤ YN0000: │ cypress@npm:3.8.3 STDERR   requireStack: [ '/tmp/tmp-277gRdCc7fOJGM/node_modules/cypress/index.js' ]
➤ YN0000: │ cypress@npm:3.8.3 STDERR }
➤ YN0009: │ cypress@npm:3.8.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/logfile-83DgzJFtIgXoXC.log)
➤ YN0000: └ Completed in 12s
➤ YN0000: Failed with errors in 12.39s
]
    at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-1.zip/node_modules/expect/build/index.js:138:15)
    at module.exports (evalmachine.<anonymous>:6:7)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:13
    at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:16)
    at async Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:12)
    at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-1.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:38)
    at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
    at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
    at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-1.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)

@arcanis Yeah, I was able to reproduce this. according to the stack trace from the logfile:

➤ YN0000: │ cypress@npm:3.8.3 STDERR Error: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required package: minimist (via "minimist")
➤ YN0000: │ cypress@npm:3.8.3 STDERR Required by: /tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/
➤ YN0000: │ cypress@npm:3.8.3 STDERR 
➤ YN0000: │ cypress@npm:3.8.3 STDERR Require stack:
➤ YN0000: │ cypress@npm:3.8.3 STDERR - /tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/index.js
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.makeError (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:7255:24)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveToUnqualified (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16111:35)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at resolveRequest (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16195:27)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.resolveRequest.maybeLog [as resolveRequest] (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:16263:26)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._resolveFilename (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15493:34)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Function.module_1.Module._load (/tmp/tmp-16064MWTMwpKFCA6T/.pnp.js:15378:40)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module.require (internal/modules/cjs/loader.js:692:17)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at require (internal/modules/cjs/helpers.js:25:18)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Object.<anonymous> (/tmp/tmp-16064MWTMwpKFCA6T/node_modules/cypress/index.js:3:16)
➤ YN0000: │ cypress@npm:3.8.3 STDERR     at Module._compile (internal/modules/cjs/loader.js:778:30)
➤ YN0009: │ cypress@npm:3.8.3 couldn't be built successfully (exit code 1, logs can be found here: /tmp/logfile-1722786XLXW0Mh6G2.log)
➤ YN0000: └ Completed in 7.58s

it is really understood what the problem is. The .pnp.js file was generated during yarn init (because the default linker is pnp) and then it was used to resolve dependencies, even though the nm-linker become active. Its understood that if there were no .pnp.js everything would have worked. But what if the case is: there is a .pnp.js, but nodeLinker is node-modules?

We couldn't reproduce your issue (all the assertions passed on master).

Good bot 🥰

Was this page helpful?
0 / 5 - 0 ratings