You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error is thrown when attempting to install TypeScript. This same issue appears to have arisen previously. See #1221.
typescript@patch:typescript@npm%3A4.3.2#builtin<compat/typescript>::version=4.3.2&hash=a45b0e: Cannot apply hunk #2 (set enableInlineHunks for details)
To Reproduce
yarn init -y
yarn set version berry
yarn add typescript --dev
Screenshots
02:05:32 ➜ yarn add typescript --dev
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ typescript@npm:4.3.2 can't be found in the cache and will be fetched from the remote registry➤ YN0013: │ typescript@patch:typescript@npm%3A4.3.2#builtin<compat/typescript>::version=4.3.2&hash=a45b0e can't be found in the cache and will be fetched from the disk
➤ YN0013: │ typescript@npm:4.3.2 can't be found in the cache and will be fetched from the remote registry➤ YN0066: │ typescript@patch:typescript@npm%3A4.3.2#builtin<compat/typescript>::version=4.3.2&hash=a45b0e: Cannot apply hunk #2 (set enableInlineHunks for details)➤ YN0000: └ Completed in 0s 602ms➤ YN0000: Failed with errors in 0s 772ms
02:02:36 ✖1 ➜ yarn
➤ YN0000: ┌ Resolution step
➤ YN0061: │ chokidar@npm:1.7.0 is deprecated: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
➤ YN0061: │ core-js@npm:2.6.12 is deprecated: core-js@<3.3 is no longer maintained and not recommended forusage due to the number of issues. Because of the V8 engine whims, feature detectionin old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
➤ YN0061: │ fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ fsevents@npm:1.2.13 is deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
➤ YN0032: │ nan@npm:2.14.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ resolve-url@npm:0.2.1 is deprecated: https://github.com/lydell/resolve-url#deprecated
➤ YN0061: │ urix@npm:0.1.0 is deprecated: Please see https://github.com/lydell/urix#deprecated
➤ YN0002: │ typescript@workspace:. doesn't provide prettier (p4351c), requested by eslint-plugin-prettier➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code➤ YN0000: └ Completed in 7s 781ms➤ YN0000: ┌ Fetch step➤ YN0013: │ yallist@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yargs-parser@npm:20.2.7 can't be found in the cache and will be fetched from the remote registry➤ YN0013: │ yargs@npm:16.2.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yn@npm:3.1.1 can't be found in the cache and will be fetched from the remote registry➤ YN0013: │ typescript@npm:4.3.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0066: │ typescript@patch:typescript@npm%3A4.3.2#builtin<compat/typescript>::version=4.3.2&hash=a45b0e: Cannot apply hunk #2
➤ YN0000: │ }
➤ YN0000: │ }
➤ YN0000: │ ts.getEffectiveTypeRoots = getEffectiveTypeRoots;
➤ YN0028: │ - functiongetDefaultTypeRoots(currentDirectory, host) {
➤ YN0028: │ + functiongetNodeModulesTypeRoots(currentDirectory, host) {
➤ YN0000: │ if (!host.directoryExists) {
➤ YN0000: │ return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
➤ YN0000: │ }
➤ YN0028: │ - var typeRoots;
➤ YN0028: │ + var typeRoots = [];
➤ YN0000: │ ts.forEachAncestorDirectory(ts.normalizePath(currentDirectory), function(directory) {
➤ YN0000: │ var atTypes = ts.combinePaths(directory, nodeModulesAtTypes);
➤ YN0000: │ if (host.directoryExists(atTypes)) {
➤ YN0028: │ - (typeRoots || (typeRoots = [])).push(atTypes);
➤ YN0028: │ + typeRoots.push(atTypes);
➤ YN0000: │ }
➤ YN0000: │ return undefined;
➤ YN0000: │ });
➤ YN0000: │ return typeRoots;
➤ YN0000: │ }
➤ YN0000: │ var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
➤ YN0028: │ + functiongetPnpTypeRoots(currentDirectory) {
➤ YN0028: │ + if (!isPnpAvailable()) {
➤ YN0028: │ + return [];
➤ YN0028: │ + }
➤ YN0028: │ + currentDirectory = ts.sys.resolvePath(currentDirectory);
➤ YN0028: │ + var pnpapi = getPnpApi();
➤ YN0028: │ + var currentPackage = pnpapi.findPackageLocator(currentDirectory + "/");
➤ YN0028: │ + if (!currentPackage) {
➤ YN0028: │ + return [];
➤ YN0028: │ + }
➤ YN0028: │ + var packageDependencies = pnpapi.getPackageInformation(currentPackage).packageDependencies;
➤ YN0028: │ + var typeRoots = [];
➤ YN0028: │ + for (var _i = 0, _a = Array.from(packageDependencies.entries()); _i < _a.length; _i++) {
➤ YN0028: │ + var _b = _a[_i], name = _b[0], referencish = _b[1];
➤ YN0028: │ + if (name.startsWith(typesPackagePrefix) && referencish !== null) {
➤ YN0028: │ + var dependencyLocator = pnpapi.getLocator(name, referencish);
➤ YN0028: │ + var packageLocation = pnpapi.getPackageInformation(dependencyLocator).packageLocation;
➤ YN0028: │ + typeRoots.push(ts.getDirectoryPath(packageLocation));
➤ YN0028: │ + }
➤ YN0028: │ + }
➤ YN0028: │ + return typeRoots;
➤ YN0028: │ + }
➤ YN0028: │ + var typesPackagePrefix = "@types/";
➤ YN0028: │ + functiongetDefaultTypeRoots(currentDirectory, host) {
➤ YN0028: │ + var nmTypes = getNodeModulesTypeRoots(currentDirectory, host);
➤ YN0028: │ + var pnpTypes = getPnpTypeRoots(currentDirectory);
➤ YN0028: │ + if (nmTypes.length > 0 || pnpTypes.length > 0) {
➤ YN0028: │ + return __spreadArray(__spreadArray([], nmTypes), pnpTypes);
➤ YN0028: │ + }
➤ YN0028: │ + }
➤ YN0000: │ functionresolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
➤ YN0000: │ var traceEnabled = isTraceEnabled(options, host);
➤ YN0000: │ if (redirectedReference) {
➤ YN0000: └ Completed in 11s 593ms
➤ YN0000: Failed with errors in 19s 380ms
Environment if relevant (please complete the following information):
OS: MacOS 11.4
Node version 14.17.0
Yarn version 2.4.1
The text was updated successfully, but these errors were encountered:
Describe the bug
An error is thrown when attempting to install TypeScript. This same issue appears to have arisen previously. See #1221.
To Reproduce
Screenshots
Environment if relevant (please complete the following information):
The text was updated successfully, but these errors were encountered: