Can't install / run in Yarn workspace
See original GitHub issueDescription
When I create a Yarn workspace and try to use create-react-native-app in it it installs all of the initial dependencies and hoists them to the root directory, but then it errors.
If I create the app in another folder outside of the project and copy/paste the contents back into the workspace and run yarn install
everything seems to run ok, but then yarn start
doesnβt work.
Expected Behavior
Running create-react-native-app
in a Yarn workspace should install and run without errors with hoisted dependencies
Observed Behavior
Using package manager as yarnpkg with yarn interface.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
yarn add v0.27.5
info No lockfile found.
[1/4] Resolving packages...
warning react-native-scripts > xdl > auth0-js > xtend > object-keys@0.4.0:
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "react-redux@5.0.5" has unmet peer dependency "react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 296 new dependencies.
ββ @ccheever/crayon@5.0.0
ββ @expo/bunyan@1.8.10
ββ @expo/json-file@5.3.0
ββ @expo/osascript@1.8.0
ββ @expo/spawn-async@1.3.0
ββ @segment/loosely-validate-event@1.1.2
ββ accepts@1.3.3
ββ ajv@4.11.8
ββ analytics-node@2.4.1
ββ ansi-escapes@2.0.0
ββ ansi-regex@3.0.0
ββ ansi-styles@3.2.0
ββ any-promise@1.3.0
ββ array-flatten@1.1.1
ββ asap@2.0.6
ββ asn1@0.2.3
ββ assert-plus@1.0.0
ββ async@1.5.2
ββ asynckit@0.4.0
ββ auth0-js@7.6.1
ββ auth0@2.7.0
ββ aws-sign2@0.6.0
ββ aws4@1.6.0
ββ babel-runtime@6.25.0
ββ balanced-match@1.0.0
ββ Base64@0.1.4
ββ base64url@2.0.0
ββ bcrypt-pbkdf@1.0.1
ββ block-stream@0.0.9
ββ bluebird@2.11.0
ββ body-parser@1.17.2
ββ boom@2.10.1
ββ brace-expansion@1.1.8
ββ buffer-equal-constant-time@1.0.1
ββ bytes@2.4.0
ββ callsite@1.0.0
ββ camel-case@1.2.2
ββ caseless@0.12.0
ββ chalk@2.0.1
ββ change-case@2.3.1
ββ cli-cursor@2.1.0
ββ cli-width@2.1.0
ββ clone@2.1.1
ββ co@4.6.0
ββ color-convert@1.9.0
ββ color-name@1.1.3
ββ combined-stream@1.0.5
ββ commander@2.11.0
ββ component-emitter@1.2.1
ββ component-type@1.2.1
ββ concat-map@0.0.1
ββ constant-case@1.1.2
ββ content-disposition@0.5.2
ββ content-type@1.0.2
ββ cookie-signature@1.0.6
ββ cookie@0.3.1
ββ cookiejar@2.1.1
ββ core-js@2.4.1
ββ core-util-is@1.0.2
ββ create-react-class@15.6.0
ββ cross-spawn@5.1.0
ββ cryptiles@2.0.5
ββ crypto-token@1.0.1
ββ dashdash@1.14.1
ββ debug@2.6.7
ββ decache@4.1.0
ββ deep-diff@0.3.4
ββ delay-async@1.1.0
ββ delayed-stream@1.0.0
ββ depd@1.1.1
ββ destroy@1.0.4
ββ dot-case@1.1.2
ββ ecc-jsbn@0.1.1
ββ ecdsa-sig-formatter@1.0.9
ββ ee-first@1.1.1
ββ encodeurl@1.0.1
ββ encoding@0.1.12
ββ es6-error@4.0.2
ββ escape-html@1.0.3
ββ escape-string-regexp@1.0.5
ββ etag@1.8.0
ββ exec-async@2.2.0
ββ exists-async@2.0.0
ββ express@4.15.3
ββ extend@3.0.1
ββ external-editor@2.0.4
ββ extsprintf@1.0.2
ββ fbjs@0.8.14
ββ figures@2.0.0
ββ file-type@4.4.0
ββ finalhandler@1.0.3
ββ forever-agent@0.6.1
ββ form-data@2.1.4
ββ formidable@1.1.1
ββ forwarded@0.1.0
ββ freeport-async@1.1.1
ββ fresh@0.5.0
ββ fs-extra@3.0.1
ββ fs.realpath@1.0.0
ββ fstream@1.0.11
ββ getpass@0.1.7
ββ glob@7.1.2
ββ graceful-fs@4.1.11
ββ har-schema@1.0.5
ββ har-validator@4.2.1
ββ has-color@0.1.7
ββ has-flag@2.0.0
ββ hasbin@1.2.3
ββ hawk@3.1.3
ββ hoek@2.16.3
ββ hoist-non-react-statics@1.2.0
ββ home-dir@1.0.0
ββ http-errors@1.6.1
ββ http-signature@1.1.1
ββ iconv-lite@0.4.15
ββ indent-string@3.2.0
ββ inflight@1.0.6
ββ inherits@2.0.3
ββ inquirer@3.2.1
ββ instapromise@2.0.7-rc.1
ββ invariant@2.2.2
ββ ip@1.1.5
ββ ipaddr.js@1.4.0
ββ is-fullwidth-code-point@2.0.0
ββ is-lower-case@1.1.3
ββ is-promise@2.1.0
ββ is-stream@1.1.0
ββ is-typedarray@1.0.0
ββ is-upper-case@1.1.2
ββ isarray@1.0.0
ββ isemail@2.2.1
ββ isexe@2.0.0
ββ isomorphic-fetch@2.2.1
ββ isstream@0.1.2
ββ items@2.1.1
ββ joi@10.6.0
ββ join-component@1.1.0
ββ js-tokens@3.0.2
ββ jsbn@0.1.1
ββ jschardet@1.5.0
ββ json-fallback@0.0.1
ββ json-schema@0.2.3
ββ json-stable-stringify@1.0.1
ββ json-stringify-safe@5.0.1
ββ json5@0.5.1
ββ jsonfile@2.4.0
ββ jsonify@0.0.0
ββ jsonp@0.0.4
ββ jsonschema@1.1.1
ββ jsonwebtoken@7.4.1
ββ jsprim@1.4.0
ββ jwa@1.1.5
ββ jws@3.1.4
ββ klaw@1.3.1
ββ lodash-es@4.17.4
ββ lodash.once@4.1.1
ββ lodash@4.17.4
ββ loose-envify@1.3.1
ββ lower-case-first@1.0.2
ββ lower-case@1.1.4
ββ lru-cache@4.1.1
ββ match-require@2.1.0
ββ md5hex@1.0.0
ββ media-typer@0.3.0
ββ merge-descriptors@1.0.1
ββ methods@1.1.2
ββ mime-db@1.29.0
ββ mime-types@2.1.16
ββ mime@1.3.4
ββ mimic-fn@1.1.0
ββ minimatch@3.0.4
ββ minimist@1.2.0
ββ mkdirp-promise@5.0.1
ββ mkdirp@0.5.1
ββ moment@2.18.1
ββ mout@0.11.1
ββ ms@2.0.0
ββ mute-stream@0.0.7
ββ mv@2.1.1
ββ mz@2.6.0
ββ ncp@2.0.0
ββ negotiator@0.6.1
ββ node-fetch@1.7.1
ββ oauth-sign@0.8.2
ββ object-assign@4.1.1
ββ object-keys@0.4.0
ββ on-finished@2.3.0
ββ once@1.4.0
ββ onetime@2.0.1
ββ opn@4.0.2
ββ os-tmpdir@1.0.2
ββ param-case@1.1.2
ββ parseurl@1.3.1
ββ pascal-case@1.1.2
ββ path-case@1.1.2
ββ path-exists@3.0.0
ββ path-is-absolute@1.0.1
ββ path-to-regexp@0.1.7
ββ performance-now@0.2.0
ββ pify@3.0.0
ββ pinkie-promise@2.0.1
ββ pinkie@2.0.4
ββ process-nextick-args@1.0.7
ββ progress@2.0.0
ββ promise-props@1.0.0
ββ promise@7.3.1
ββ prop-types@15.5.10
ββ proxy-addr@1.1.5
ββ pseudomap@1.0.2
ββ punycode@1.3.2
ββ qrcode-terminal@0.11.0
ββ qs@6.4.0
ββ querystring@0.2.0
ββ range-parser@1.2.0
ββ raw-body@2.2.0
ββ react-native-scripts@1.1.0
ββ react-redux@5.0.5
ββ read-chunk@2.1.0
ββ readable-stream@2.3.3
ββ redux-logger@2.10.2
ββ redux@3.7.2
ββ regenerator-runtime@0.10.5
ββ remove-trailing-slash@0.1.0
ββ request-progress@3.0.0
ββ request@2.81.0
ββ reqwest@2.0.5
ββ rest-facade@1.5.0
ββ restore-cursor@2.0.0
ββ rimraf@2.6.1
ββ run-async@2.3.0
ββ rx-lite-aggregates@4.0.8
ββ rx-lite@4.0.8
ββ safe-buffer@5.1.1
ββ safe-json-stringify@1.0.4
ββ semver@5.4.1
ββ send@0.15.3
ββ sentence-case@1.1.3
ββ serve-static@1.12.3
ββ setimmediate@1.0.5
ββ setprototypeof@1.0.3
ββ shebang-command@1.2.0
ββ shebang-regex@1.0.0
ββ signal-exit@3.0.2
ββ slugid@1.1.0
ββ slugify@1.1.0
ββ snake-case@1.1.2
ββ sntp@1.0.9
ββ source-map-support@0.4.15
ββ source-map@0.5.6
ββ sshpk@1.13.1
ββ statuses@1.3.1
ββ string_decoder@1.0.3
ββ string-width@2.1.1
ββ stringstream@0.0.5
ββ strip-ansi@4.0.0
ββ superagent-retry@0.6.0
ββ superagent@3.5.2
ββ supports-color@4.2.1
ββ swap-case@1.1.2
ββ symbol-observable@1.0.4
ββ tar.gz@1.0.5
ββ tar@2.2.1
ββ thenify-all@1.6.0
ββ thenify@3.3.0
ββ throttleit@1.0.0
ββ through@2.3.8
ββ title-case@1.1.2
ββ tmp@0.0.31
ββ topo@2.0.2
ββ tough-cookie@2.3.2
ββ tree-kill@1.1.0
ββ trim@0.0.1
ββ tunnel-agent@0.6.0
ββ tweetnacl@0.14.5
ββ type-is@1.6.15
ββ ua-parser-js@0.7.14
ββ universalify@0.1.1
ββ unpipe@1.0.0
ββ upper-case-first@1.1.2
ββ upper-case@1.1.3
ββ url@0.11.0
ββ util-deprecate@1.0.2
ββ utils-merge@1.0.0
ββ uuid@3.1.0
ββ vary@1.1.1
ββ verror@1.3.6
ββ whatwg-fetch@2.0.3
ββ which@1.3.0
ββ winchan@0.1.4
ββ workspace-aggregator-d5775bd2-6a4e-47ad-8069-d4b04fbcc2f1@0.0.0
ββ wrappy@1.0.2
ββ xdl@43.0.0
ββ xhr2@0.1.4
ββ xtend@4.0.1
ββ yallist@2.1.2
ββ yesno@0.0.1
Done in 12.96s.
(node:42384) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error:
ENOENT: no such file or directory, open 'C:\robdonn\Personal\robdonn\test\apps\native\node_modules\
react-native-scripts\package.json'
(node:42384) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the futur
e, promise rejections that are not handled will terminate the Node.js process with a non-zero exit c
ode.
Environment
Please run these commands in the project folder and fill in their results:
npm ls react-native-scripts
:
native@0.1.0 C:\robdonn\Personal\robdonn\test\apps\native
`-- (empty)
npm ls react-native
:
native@0.1.0 C:\robdonn\Personal\robdonn\test\apps\native
`-- (empty)
npm ls expo
:
native@0.1.0 C:\robdonn\Personal\robdonn\test\apps\native
`-- (empty)
node -v
:v8.2.1
npm -v
:5.3.0
yarn --version
:0.27.5
watchman version
:Please specify a target and action
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Workspaces
Finally, run yarn install somewhere, ideally inside the workspace root. ... It won't be there unless some other package use it as a...
Read more >yarn not installing packages from workspace but instead ...
In your app's package.json , try these. "tsconfig": "*", "eslint-config-custom": "*",. In pnpm , packages are installed by workspaces:*Β ...
Read more >npm, pnpm, and Yarn | IntelliJ IDEA Documentation
IntelliJ IDEA integrates with the npm, Yarn, Yarn 2, and pnpm, so you can install, locate, update, and remove packages of reusable code...
Read more >Advanced package manager features for npm, Yarn, and ...
npm workspaces; Yarn Berry workspaces; pnpm workspaces ... If you add, update, or remove dependencies, you have to run yarn install ...
Read more >A guide through The Wild Wild West of setting up a mono repo ...
We will be using TypeScript, Yarn workspaces, Lerna, and Jest. ... so running yarn install from within a package may break the meta...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey everyone, I figure since I opened this issue then I should resolve it.
The trick is a recent feature of yarn workspaces,
nohoist
. Thenohoist
option allows you to specify packages/directories that you do not want to be hoisted.root package.json
I hope this helps anyone out there. More info
@brentvatne This still isnβt working. It would be real nice if it could be resolved. I think all that needs to change is how Exp looks for react native.