Skip to content
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

Install fails when using yarn workspaces #22

Closed
OliverJAsh opened this issue Feb 17, 2018 · 5 comments · Fixed by #53
Closed

Install fails when using yarn workspaces #22

OliverJAsh opened this issue Feb 17, 2018 · 5 comments · Fixed by #53

Comments

@OliverJAsh
Copy link

When using yarn workspaces to install this package, I get an error. This is similar to #9.

$ yarn workspace server add full-icu
yarn workspace v1.3.2
yarn add v1.3.2
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
[1/1] ⠄ full-icu: yarn install v1.3.2
[-/1] ⠄ waiting...
[-/1] ⠄ waiting...
[-/1] ⠄ waiting...
error /Users/OliverJAsh/Development/twitter-paper/node_modules/full-icu: Command failed.
Exit code: 1
Command: node postinstall.js
Arguments:
Directory: /Users/OliverJAsh/Development/twitter-paper/node_modules/full-icu
Output:
npm install icu4c-data@59l (Node 8.1.4 and small-icu 59.1) -> icudt59l.dat
full-icu$ /Users/OliverJAsh/.nvm/versions/node/v8.1.4/bin/node /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js install icu4c-data@59l
yarn install v1.3.2
info No lockfile found.
error `install` has been replaced with `add` to add new dependencies. Run "yarn add icu4c-data@59l" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
/Users/OliverJAsh/Development/twitter-paper/node_modules/full-icu/install-spawn.js:41
		throw(Error(cmdPath + ' ' + args.join(' ') + ' --> status ' + spawned.status));
		^

Error: /Users/OliverJAsh/.nvm/versions/node/v8.1.4/bin/node /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js install icu4c-data@59l --> status 1
    at npmInstallNpm (/Users/OliverJAsh/Development/twitter-paper/node_modules/full-icu/install-spawn.js:41:9)
    at Object.<anonymous> (/Users/OliverJAsh/Development/twitter-paper/node_modules/full-icu/postinstall.js:68:2)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)




error Command failed.
Exit code: 1
Command: /Users/OliverJAsh/.nvm/versions/node/v8.1.4/bin/node
Arguments: /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js add full-icu
Directory: /Users/OliverJAsh/Development/twitter-paper/src/server
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.

As a workaround, if I cd to the workspace and run:

yarn add full-icu

it works.

@srl295
Copy link
Member

srl295 commented Apr 20, 2018

I have not used workspaces. Probably needs a different way to detect yarn.

@Swatinem
Copy link

Exit code: 1
Command: node postinstall.js
Arguments:
Directory: …/node_modules/full-icu
Output:
npm install icu4c-data@62l (Node 10.15.3 and small-icu 62.1) -> icudt62l.dat
Looks like you are using yarn…
full-icu$ …/node …/node_modules/yarn/bin/yarn.js add icu4c-data@62l --no-lockfile --ignore-scripts
yarn add v1.16.0
error An unexpected error occurred: "Cannot read property 'manifest' of undefined".
info If you think this is a bug, please open a bug report with the information provided in "…/node_modules/full-icu/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
…/node_modules/full-icu/install-spawn.js:41
		throw(Error(cmdPath + ' ' + args.join(' ') + ' --> status ' + spawned.status));
		^

With workspaces, the monorepo only has a single lockfile, not sure if that is the problem though? But the problem seems yarn related…

@Andret2344
Copy link

Still having the same issue on yarn add -D full-icu:

error <FULL_PATH>\node_modules\full-icu: Command failed.
Exit code: 1
Command: node postinstall.js
Arguments:
Directory: C:\Users\Andret\PhpstormProjects\mfpkis\node_modules\full-icu
Output:
npm install icu4c-data@67l (Node 12.18.0 and small-icu 67.1) -> icudt67l.dat
Looks like you are using yarn…
full-icu$ C:\Program Files\nodejs\node.exe C:\Program Files (x86)\Yarn\bin\yarn.js add icu4c-data@67l --no-lockfile --ignore-scripts
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
C:\Program Files (x86)\Yarn\lib\cli.js:66073
            throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode);
            ^

ResponseError: Request failed "503 Service Unavailable"
    at ResponseError.ExtendableBuiltin (C:\Program Files (x86)\Yarn\lib\cli.js:696:66)
    at new ResponseError (C:\Program Files (x86)\Yarn\lib\cli.js:802:124)
    at Request.params.callback [as _callback] (C:\Program Files (x86)\Yarn\lib\cli.js:66073:19)
    at Request.self.callback (C:\Program Files (x86)\Yarn\lib\cli.js:140748:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:141720:10)
    at Request.emit (events.js:315:20)
    at IncomingMessage.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:141642:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22) {
  responseCode: 503
}
C:\Users\Andret\PhpstormProjects\mfpkis\node_modules\full-icu\install-spawn.js:62
                throw(Error(cmdPath + ' ' + args.join(' ') + ' --> status ' + spawned.status));
                ^

Error: C:\Program Files\nodejs\node.exe C:\Program Files (x86)\Yarn\bin\yarn.js add icu4c-data@67l --no-lockfile --ignore-scripts --> status 1
    at npmInstallNpm (C:\Users\Andret\PhpstormProjects\mfpkis\node_modules\full-icu\install-spawn.js:62:9)
    at Object.<anonymous> (C:\Users\Andret\PhpstormProjects\mfpkis\node_modules\full-icu\postinstall.js:72:2)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)

@DavideDaniel
Copy link

DavideDaniel commented Jun 27, 2020

yarn 2 and workspaces is a completely different world in some ways. For example, the node_modules folder is largely gone.. only necessary for certain packages that are not yet converted to work with yarn 2 world.. most notably, from my understanding full-icu is relying on postinstall and yarn 2 has issues with it (https://yarnpkg.com/advanced/lifecycle-scripts#a-note-about-postinstall). We are probably going to stop using full-icu unfortunately.. I've been mulling it over about how to leverage it without having to choose between the 2. My current thought was to use full-icu in the environment but not as part of my package.json install probably. It could be in a parent package outside the workspace maybe.. tbd...

@srl295
Copy link
Member

srl295 commented Sep 24, 2021

fixed by #38 no longer trying to do a sub install

@srl295 srl295 linked a pull request Sep 24, 2021 that will close this issue
@srl295 srl295 closed this as completed in #53 Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants