Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I cannot install some packages globally when in Windows and using Git Bash.
For example, for @nrwl/schematics
(but also for @angular/cli
) I get
$ yarn global add @nrwl/schematics
yarn global v1.7.0
[1/4] Resolving packages...
error An unexpected error occurred: "https://https://registry.yarnpkg.com/@nrwl/schematics: Not found".
Error log:
Error: https://registry.yarnpkg.com/@nrwl/schematics: Not found
at Request.params.callback [as _callback] (C:Program Files (x86)Yarnlibcli.js:65656:18)
at Request.self.callback (C:Program Files (x86)Yarnlibcli.js:134675:22)
at Request.emit (events.js:159:13)
at Request.<anonymous> (C:Program Files (x86)Yarnlibcli.js:135658:10)
at Request.emit (events.js:159:13)
at IncomingMessage.<anonymous> (C:Program Files (x86)Yarnlibcli.js:135578:12)
at Object.onceWrapper (events.js:254:19)
at IncomingMessage.emit (events.js:164:20)
at endReadableNT (_stream_readable.js:1062:12)
at process._tickCallback (internal/process/next_tick.js:152:19)
In Ubuntu it seems to work just fine.
Same if I use the Windows PowerShell instead of Git Bash.
If the current behavior is a bug, please provide the steps to reproduce.
See above
What is the expected behavior?
That packages are installed
Please mention your node.js, yarn and operating system version.
$ node -v
v9.3.0
$ yarn config list
yarn config v1.7.0
info yarn config
{ 'version-tag-prefix': 'v',
'version-git-tag': true,
'version-commit-hooks': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'bin-links': true,
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.yarnpkg.com',
'strict-ssl': true,
'user-agent': 'yarn/1.7.0 npm/? node/v9.3.0 win32 x64',
lastUpdateCheck: 1527149439512 }
info npm config
{}
Windows 10
I have react native project that I worked on my laptop. when I transfer the project to my pc and run yarn install (I installed the some modules using yarn and some using npm) I get
An unexpected error occurred: «https://registry.yarnpkg.com/jest/-/jest-23.0.0-alpha.0.tgz: Request failed «404 Not Found»».
Yarn version on my pc and latop same
1.5.1
npm version my pc and latop same
5.4.1
node version
v 7.9.0
in addition i get warning when run yarn install on my project
warning You are using Node "7.9.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
tk421
5,6956 gold badges23 silver badges34 bronze badges
asked Mar 19, 2018 at 19:42
2
I found a solution
yarn config set registry https://registry.npmjs.org
rm yarn.lock
yarn
answered Mar 19, 2018 at 20:30
ManspofManspof
39625 gold badges75 silver badges167 bronze badges
2
I had a similar issue, getting:
An unexpected error occurred: "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.0.tgz: Request failed "404 Not Found"".
Deleting yarn.lock
and running yarn
may result in a lot of packages being upgraded, and possibly other configuration issues.
Instead, I just deleted the es-abstract
resolution section from yarn.lock
, e.g.:
es-abstract@^1.11.0, es-abstract@^1.5.1, es-abstract@^1.7.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.0.tgz#f59d9d44278ea8f90c8ff3de1552537c2fd739b4"
integrity sha512-lri42nNq1tIohUuwFBYEM3wKwcrcJa78jukGDdWsuaNxTtxBFGFkKUQ15nc9J+ipje4mhbQR6JwABb4VvawR3A==
dependencies:
es-to-primitive "^1.2.0"
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.0"
is-callable "^1.1.4"
is-regex "^1.0.4"
object-inspect "^1.6.0"
object-keys "^1.1.1"
string.prototype.trimleft "^2.0.0"
string.prototype.trimright "^2.0.0"
and run yarn
. This solved the issue with a minimal number of upgrades in yarn.lock
.
answered Jan 8, 2020 at 22:14
Bjørn EgilBjørn Egil
2,3481 gold badge19 silver badges22 bronze badges
If you are getting this with a private npm
package, make sure you are logged in with the proper user
run npm login
Docs
answered May 26, 2020 at 6:28
Sagiv b.gSagiv b.g
29.8k8 gold badges68 silver badges98 bronze badges
I had this problem today in CircleCI, turned out to be a cache problem:
yarn cache clean
yarn install
Actually I had to run yarn install
twice but no idea why.
answered Aug 6, 2020 at 11:34
josemigallasjosemigallas
3,6371 gold badge29 silver badges64 bronze badges
following worked for npm
npm config set registry https://registry.npmjs.org
rm package.json && rm nodemodules
npm install
answered Jun 21, 2022 at 12:08
То же сообщение об ошибке, но, возможно, другая причина?
$ docker run --rm node:10 yarn global add @types/[email protected]
yarn global v1.7.0
[1/4] Resolving packages...
(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@types/graphql/-/graphql-0.12.4.tgz: Request failed "404 Not Found"".
Да, кажется, другой. Кажется, что у меня это вызвано использованием Git Bash и его странным поведением вокруг символа «/» в Windows.
Сегодня я заметил, что теперь он не устанавливает никаких пакетов с пространством имен, вероятно, потому, что по каким-то непонятным причинам он преобразует «/» в обратную косую черту …
Кажется, это происходит случайно — если я запускаю curl несколько раз, примерно в 10% случаев работает следующее:
curl 'https://registry.yarnpkg.com/@types/node/-/node-9.4.2.tgz'
Возникла такая же проблема во время сборки CI, всегда происходит сбой на том же URL- адресе, который опубликован
Тот же сбой, что и
Кажется, что пакет ссылочных типов в https://registry.npmjs.org/@types/node/-/node-9.4.2.tgz
исчез, хотя он все еще упоминается в реестре https: //. yarnpkg.org/@types/node -> versions.9.4.2.dist.tarball
Кто-нибудь из команды разработчиков пряжи знает, почему это удалено?
кажется, что node-9.6.0 + доступен, однако при обновлении до yarn 1.7.0, используя node 10, он все еще пытается вытащить tarball типов node-9.4.3 , не влияет на это и, скорее всего, из деп (например, в моем случае)
попробует обновить типы деп и отчитаться
да, обновление моего @ types / node dep до 9.6.0 сработало. не идеал, но работал.
Я думаю, важно упомянуть, что это проблема не только пряжи, поскольку я обнаружил ту же проблему, используя только npm, и обнаружил, что архивы @ types / 9.4.2 и 9.4.3 отсутствуют в межсетях, что может быть связано с удалением из этих пакетов с помощью Определенного Типа или проблемы с хранилищем на npmjs.org, я не смог найти много другой информации по этой проблеме, поэтому я добавляю контекст
Привет всем, внимание! Была такая же проблема на Mac, и я смог решить ее, выполнив следующие действия:
- Обновлен до последней версии пряжи (на самом деле может не понадобиться, но хочу отметить, что это был шаг, который я сделал )
- удалить
node_modules
- удалить
yarn.lock
yarn install
И все заработало / установило как положено.
Я догадываюсь, что важным шагом является удаление yarn.lock
.
@anied У меня тоже есть аналогичная проблема, но когда я yarn.lock
->, появляется сообщение «Файл блокировки не найден» и процесс завершается.
После обновления Yarn 1.6.0 до 1.7.0 я просто удалил файл блокировки и запустил yarn install
. Затем мои команды yarn add
снова начали работать без каких-либо проблем
Первый
npm install
а потом…
yarn
Аргументы:
/ usr / local / bin / node / usr / bin / yarn добавить react-native-modelbox
ПУТЬ:
/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / snap / bin
Версия пряжи:
1.7.0
Версия узла:
10.4.1
Платформа:
Linux x64
След:
Ошибка: https://registry.yarnpkg.com/react-native-modelbox : не найдено
в Request.params.callback [как _callback] (/usr/lib/node_modules/yarn/lib/cli.js:65656:18)
в Request.self.callback (/usr/lib/node_modules/yarn/lib/cli.js:134675:22)
в Request.emit (events.js: 182: 13)
по запросу.(/usr/lib/node_modules/yarn/lib/cli.js:135658:10)
в Request.emit (events.js: 182: 13)
в IncomingMessage.(/usr/lib/node_modules/yarn/lib/cli.js:135578:12)
в Object.onceWrapper (events.js: 273: 13)
в IncomingMessage.emit (events.js: 187: 15)
в endReadableNT (_stream_readable.js: 1081: 12)
в process._tickCallback (внутренний / процесс / next_tick.js: 63:19)
Аналогичная проблема:
> npx create-react-app --info
Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
Node: 12.1.0 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 73.0.3683.103
Firefox: Not Found
Safari: 12.1
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
> npx create-react-app my-app
Creating a new React app in /Users/jklo/projects/jnwc/source/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.15.2
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-9.0.1.tgz: Request failed "404 Not Found"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/jklo/projects/jnwc/source/my-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Users/jklo/projects/jnwc/source/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
пряжа-error.log
Curl может скачать пакет без проблем. ~ Не могу понять, как это обойти. ~
edit: Я определил проблему … это, безусловно, ужасное сообщение об ошибке с помощью пряжи или npm (не уверен, переопределяет пряжу функции npm или нет). Оказывается, в моем случае у меня были плохие учетные данные для аутентификации в моем ~/.npmrc
, которые после удаления позволили снова загрузить пакеты с ограниченной областью действия. Меня все еще немного смущает мое наблюдение, почему это было проблемой только для некоторых пакетов, особенно пакетов с ограниченной областью видимости.
Была такая же проблема. Я изменил свой ~/.npmrc
на always-auth = false
. Теперь работает.
@jaapaurelio
Я добавляю, но не работает. У тебя есть какое-нибудь решение?
Выполнение следующей команды в терминале устранило мою проблему:
yarn config set strict-ssl false
Я не знаю, что делает этот параметр конфигурации, но, учитывая название, не кажется хорошей идеей устанавливать для него значение false случайным образом …
Можете ли вы объяснить, почему вы это сделали и что это должно делать?
Привет, для меня это доставляло проблемы из-за моей строго защищенной корпоративной сети. Это просто позволило мне обойти это. Я бы просто удостоверился, что вы знаете, какие пакеты вы устанавливаете в первую очередь, а затем вернул бы его обратно к true. Но я далеко не эксперт в этом, поэтому, если у кого-то есть какие-либо идеи относительно возможных опасностей здесь, я хотел бы прочитать о них. Всем привет.
Была эта ошибка с sinon:
из packge.json:
"sinon": "^7.0.0",
Ошибка в терминале:
error An unexpected error occurred: "https://registry.yarnpkg.com/sinon/-/sinon-7.4.0.tgz: Request failed "404 Not Found"".
Я смог решить это с помощью:
yarn upgrade --latest sinon
Это заставило пряжу искать sinon-7.4.1.tgz вместо этого.
Наши сборки периодически выходили из строя с этой же ошибкой в течение последних нескольких дней. Первый сбой, который мы заметили, произошел в 2019-09-30T00: 01 UTC.
Сбои случаются довольно часто (но не каждый раз, скорее, в 80-90% случаев). Это всегда одна и та же ошибка, но пока для 4 разных пакетов:
- https://registry.yarnpkg.com/@reach/router/ — / router-1.2.1.tgz
- https://registry.yarnpkg.com/@storybook/react -stubber / — / react-stubber-1.0.1.tgz
- https://registry.yarnpkg.com/@xtuc/ieee754/ — / ieee754-1.2.0.tgz
- https://registry.yarnpkg.com/@xtuc/long/ — / long-4.2.2.tgz
Каждый из этих пакетов является общедоступным, и каждая неудачная версия является последней опубликованной, поэтому обновление до более новой версии невозможно. Выполнение запроса curl
непосредственно с одной из машин сборки возвращает ответ 200 OK
.
Приведенные выше различные предложения (и во многих других вопросах) по удалению yarn.lock
и повторной установке модулей не будут работать, потому что это полностью лишает смысла использование файла блокировки в первую очередь. Это приведет к обновлению каждой транзитивной зависимости вместо того, чтобы на самом деле исправить то, что явно является периодической проблемой с самим реестром.
root<strong i="5">@TRON</strong>:/mnt/c/indospace.io/services# yarn upgrade --latest
yarn upgrade v1.19.0
warning package.json: No license field
error No lockfile in this directory. Run `yarn install` to generate one.
info Visit https://yarnpkg.com/en/docs/cli/upgrade for documentation about this command.
root<strong i="6">@TRON</strong>:/mnt/c/indospace.io/services# yarn install
yarn install v1.19.0
warning package.json: No license field
info No lockfile found.
warning No license field
[1/5] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/binlookup: getaddrinfo EAI_AGAIN registry.yarnpkg.com".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/indospace.io/services/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
root<strong i="7">@TRON</strong>:/mnt/c/indospace.io/services#
Я согласен, реестр пряжи сейчас полностью испорчен. Никогда не видел такого плохого с моей стороны … продолжаю получать эти сетевые ошибки. Я удалил блокировку пряжи и попробовал массу решений, которые раньше работали для меня … не знаю, что делать.
Задача решена! Не проблема пряжи, а скорее подсистема Windows для Linux (WSL): проблема подключения.
Как ни странно, мне просто нужно было перезагрузить компьютер. Старый добрый выключил и включил снова. Я пробовал несколько разных вещей, включая вышеперечисленные решения, но перезапуск помог.
Задача решена! Не проблема пряжи, а скорее подсистема Windows для Linux (WSL): проблема подключения.
У меня такая же проблема. Я тоже использую WSL. Не могли бы вы рассказать, как вы ее решили? 😄
Я использую macOS, и, как и @RyanPWalker, я просто перезагрузился, и ошибка исчезла.
Я просто удаляю файл yarn.lock и снова пытаюсь добавить пряжу, это сработало!
Я сейчас вижу эту ошибку при попытке запустить сборки на CodeBuild:
error An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed "404 Not Found"".
Я могу подтвердить, что это все еще происходит в Канаде.
Происходит прямо сейчас в Европе.
если это проблема с каким-то вашим пакетом (или зарегистрированным пакетом вашего проекта / компании), проблема может быть связана с NPM_TOKEN
проверить, правильный ли он и не изменился
для меня эта проблема возникла, когда я выполнял сборку образа Docker, эта ошибка была исправлена путем удаления модулей узлов и файлов lock.yarn
и lock.json
а затем путем выполнения этих шагов для установки пряжи и сборки проект с использованием yarn
.
1) curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
2) sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg>
3) sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg>
4) sudo yum install yarn
и наконец,
5) yarn
Этот процесс прошел успешно, но я все еще не могу успешно создать образ Docker.
ОШИБКА:
error Произошла непредвиденная ошибка: « https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz : getaddrinfo EAI_AGAIN registry.yarnpkg.com».
Выполнение следующей команды в терминале устранило мою проблему:
yarn config set strict-ssl false
работает как шарм
Та же проблема!
error An unexpected error occurred: "https://registry.yarnpkg.com/grid-styled/-/grid-styled-4.1.0.tgz: unexpected end of file
WSL v1 под windows 10
[email protected]
Node.js v12.18.2.
Выполнено по данному репо:
https://github.com/metabase/metabase
Windows 10
Кажется, у меня тоже возникает эта проблема, когда я использую WSL. Также случается, когда я тоже пытаюсь использовать npm. Когда я переключаюсь на репо в своей файловой системе Windows и запускаю yarn install, все в порядке.
ошибка может быть вызвана неверно названной зависимостью в вашем package.json. Я не знаю почему, но похоже, что и yarn, и npm проверяют все ваши зависимости при каждой установке.
PS C: Projects dakota> пряжа устаревшая
пряжа устаревшая v1.22.4
error Произошла непредвиденная ошибка: « https://registry.yarnpkg.com/@bugsnag%2fjs : Not found».
info Если вы считаете, что это ошибка, откройте отчет об ошибке, указав информацию в «C: Projects MyProject yarn-error.log».
info Посетите https://yarnpkg.com/en/docs/cli/outdated для документации по этой команде.
Собираюсь стереть мой файл блокировки пряжи и модули узлов и доложить. Нормальная пряжа и пряжа начинают работать нормально, только ревизия лажает. Это произошло после обновления моего [email protected] до [email protected]
Я получаю это последние 1 час. Кто-нибудь еще?
Я получаю это последние 1 час. Кто-нибудь еще?
мне2
Сколько времени нужно, чтобы это исправить?
Я получаю это последние 1 час. Кто-нибудь еще?
Тоже самое
Сколько времени нужно, чтобы это исправить?
время сделать перерыв на кофе
~ У нас была такая же проблема с @vimeo/player
и мы решили ее, обновив эту зависимость до последней версии. ~
Обновление — https://status.npmjs.org/
По крайней мере, на этот раз проблема не полна мемов: upside_down_face:
Быть учителем и иметь эту проблему в день технического тестирования студентов … Плохой день! 😢
Рад, что продолжил прокрутку и нашел эти последние сообщения. Собирался перевернуть мой стол: smile:
Я давно должен был прокрутить вниз!
Все еще происходит, даже если на этой странице написано: «Обновление: проблема с веб-сайтом npm была решена ….»
Я тоже получаю эту ошибку, я пытаюсь установить response-native-image-crop-picker и получаю эту ошибку.
пряжа добавить v1.22.4
[1/4] Обработка пакетов …
[2/4] Получение пакетов …
error Произошла непредвиденная ошибка: » https://registry.yarnpkg.com/@react-native-community/async -storage / — / async-storage-1.11.0.tgz: Запрос не выполнен » 404 Not Found «» .
По-прежнему не удается установить пакеты на моей стороне.
То же самое и со мной сейчас.
У меня такая же проблема с @ response-native-community /
О, спасибо, что я не один. Я уже думал, что сошел с ума …
Все еще сталкиваюсь с проблемой … Рад, что сохранил копию своих node_modules.
Умный аргумент, почему разработчик не должен работать много часов подряд 🙃
Никогда не удаляйте папку node_modules
: man_facepalming:: man_facepalming:
Не удалось найти пакет «@ typescript-eslint / eslint-plugin @ ^ 1.5.0», необходимый для «@ response-native-community / eslint-config @ ^ 0.0.7» в реестре «npm»
Я получаю подобную ошибку при создании образа докера. Я буквально все перепробовал, но все равно показывает:
Sending build context to Docker daemon 258.8MB
Step 1/6 : FROM mhart/alpine-node
---> 5e6dbbca4cab
Step 2/6 : WORKDIR /app
---> Using cache
---> 480d384dc9f0
Step 3/6 : COPY /build .
---> Using cache
---> 7ef150a69ac5
Step 4/6 : COPY /buildenv .
---> Using cache
---> 2ce3c6384603
Step 5/6 : RUN yarn
---> Running in 3acf4706c177
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@zeit/schemas/-/schemas-2.6.0.tgz: Request failed "404 Not Found"".
info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn' returned a non-zero code: 1
npm === программное обеспечение && npm.registry.status === ‘вниз’
Никогда не удаляйте папку
node_modules
🤦♂️ 🤦♂️
Я сделал это сейчас, я застрял. Думаю, сегодня я заканчиваю свою работу.
Никогда не удаляйте папку
node_modules
🤦♂️ 🤦♂️Я сделал это сейчас, я застрял. Думаю, сегодня я заканчиваю свою работу.
Если у вас есть репо для вашего проекта, клонируйте его и запустите yarn install. Ваш проект по-прежнему будет работать локально
Запрос не выполнен «404 Not Found » «
Я пробовал разные методы около 16:00.
Я хочу написать код
Но npm думает иначе
сталкивается с той же проблемой …
пряжа установить v1.19.1
[1/4] Обработка пакетов …
ошибка Не удалось найти пакет «@ sendgrid / [email protected] », необходимый для «@ anchan828 / nest-sendgrid @ ^ 0.3.8», в реестре «npm».
info Посетите https://yarnpkg.com/en/docs/cli/install для документации по этой команде.
rm -rf ~/.yarn
сотворила для меня волшебство.
rm -rf ~/.yarn
сотворила для меня волшебство.
Безопасно ли запускать эту команду ??
@Vadi это не решает проблемы. пожалуйста проверьте внимательно))
Пожалуйста, ребята, дайте решение этой проблемы как можно скорее
@Vadi Я пробовал, но проблема все еще существует.
rm -rf ~/.yarn
сотворила для меня волшебство.Безопасно ли запускать эту команду ??
Никогда не удаляйте папку
node_modules
🤦♂️ 🤦♂️
Никогда не удаляйте кеш пряжи 🤦♂️
rm -rf ~/.yarn
сотворила для меня волшебство.
ребята, он удаляет только двоичный файл yarn
. это не решение.
Yarn version:
1.22.4
Node version:
10.16.3
Platform:
darwin x64
Trace:
Error: https://registry.yarnpkg.com/@react-native-firebase/app-types/-/app-types-6.7.2.tgz: Request failed "503 Service Unavailable"
at ResponseError.ExtendableBuiltin (/usr/local/lib/node_modules/yarn/lib/cli.js:696:66)
at new ResponseError (/usr/local/lib/node_modules/yarn/lib/cli.js:802:124)
at Request.<anonymous> (/usr/local/lib/node_modules/yarn/lib/cli.js:67057:16)
at Request.emit (events.js:198:13)
at Request.module.exports.Request.onRequestResponse (/usr/local/lib/node_modules/yarn/lib/cli.js:141625:10)
at ClientRequest.emit (events.js:203:15)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
at TLSSocket.socketOnData (_http_client.js:442:20)
at TLSSocket.emit (events.js:198:13)
Кому-нибудь повезло?
Если мы не работаем в NPM, нам просто нужно подождать …
npx react-native init ILoveNPM
теперь работает … 👏 (установка всех зависимостей через NPM и так далее)
После разрушения сборки на уровне производства … теперь она снова работает
Еще одно обновление:
Обновление — мы заменили неисправный кеш, и наши телеметрические данные показывают значительное улучшение количества ошибок. Мы продолжим следить за ситуацией и позаботимся о том, чтобы все вопросы были полностью решены.
6 августа, 11:36 UTC
Статус НПМ
Теперь он работает, спасибо
У меня это сработало, хотя на странице статуса npm по-прежнему отображается частичное отключение.
Вид облегчения!
Спасибо npm
🎉🎉🎉🎉
Теперь работает нормально!
Работает в настоящее время. Благодаря!
Работает в настоящее время…:)
Yarn version:
1.22.4
Node version:
12.16.2
Platform:
win32 x64
Trace:
Error: https://registry.npmjs.org/@material-ui%2fcore/i18next: Request "https://registry.npmjs.org/@material-ui%2fcore/i18next" returned a 405
at Request.params.callback [as _callback] (C:Program Files (x86)Yarnlibcli.js:66105:18)
at Request.self.callback (C:Program Files (x86)Yarnlibcli.js:140748:22)
at Request.emit (events.js:310:20)
at Request.<anonymous> (C:Program Files (x86)Yarnlibcli.js:141720:10)
at Request.emit (events.js:310:20)
at IncomingMessage.<anonymous> (C:Program Files (x86)Yarnlibcli.js:141642:12)
at Object.onceWrapper (events.js:416:28)
at IncomingMessage.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Все еще случается со мной
yarn config set registry https://registry.npmjs.org
rm yarn.lock
yarn
работал на меня
Была такая же проблема здесь и не работало ни одно из решений! Мой гоши
Не работает ребята!
$ пряжа добавить реагировать-маршрут-дом
пряжа добавить v1.22.4
[1/4] Обработка пакетов …
error Произошла непредвиденная ошибка: « https://registry.yarnpkg.com/react-route-dom : Not found».
info Если вы считаете, что это ошибка, откройте отчет об ошибке, указав информацию в папке «C: wamp64 www myapp y»
arn-error.log «.
бежать
yarn config set registry https://registry.npmjs.org
сделаю работу
Я использовал свой телефон в качестве точки доступа. Перезагрузка телефона устранила проблему 🤷
бежать
yarn config set registry https://registry.npmjs.org
сделаю работу
У меня не работает
Если вы находитесь внутри интрасети, проверьте, к какому реестру вы подключаетесь. Возможно, вас заблокировали в реестре npmjs.org.
$ пряжа global add @ nrwl / schematics
пряжа global v1.7.0
[1/4] Обработка пакетов …
error Произошла непредвиденная ошибка: « https: // https : //registry.yarnpkg.com/@nrwl/schematics: Not found».
Больше информации:
Эта ошибка возникает не только в macOS, но и в Linux (Ubuntu, CentOS).
В моем случае эта ошибка была связана с неправильной работой докера, вероятно, после некоторого изменения правил iptables.
После перезапуска службы докеров у меня все работает нормально.
$ sudo systemctl restart docker
Была ли эта страница полезной?
5 / 5 — 1 рейтинги
Issue
After uninstalling the react-native-cli
i run this command to initiate a RN project with typescript template:
npx react-native init MyApp --template react-native-template-typescript
but i got this error:
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom
[email protected]: use String.prototype.padStart() error An unexpected error occurred:
“https://registry.yarnpkg.com/react-native-template-react-native-template-typescript:
Not found”.info If you think this is a bug, please open …..
[1/2] Removing module
react-native-template-react-native-template-typescript…
error This module isn’t specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation
about this command. warn
Failed to clean up template temp files in
node_modules/react-native-template-react-native-template-typescript.
This is not a critical error, you can work on your app.
(node:8548) UnhandledPromiseRejectionWarning: Error: Command failed:
yarn add react-native-template-react-native-template-typescript
Solution
Resolved: i had to remove react native cli using yarn too
yarn remove global react-native-cli
Answered By – Yacine
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0
Anton Golub
Posted on Jul 10, 2020
• Updated on May 12, 2021
tl;dr
npx yarn-audit-fix
Enter fullscreen mode
Exit fullscreen mode
Issue
Auditing and updating dependencies is an important part of the code lifecycle. There are different approaches to implement this task: services (renovate, snyk, dependabot and so on) and instruments (npm, yarn).
If you develop proprietary things in an isolated environment, external services are most likely unavailable. If you use monorepos, yarn is your only choice.
But there is a problem.
yarn audit fix
Enter fullscreen mode
Exit fullscreen mode
…does not quite what is expected. It just shows vulnerabilities, but doesn’t fix them. And here is a long discussion of why this happens: https://github.com/yarnpkg/yarn/issues/7075
Most workarounds are based on different variations of semi-manual dependency patching.
- how-to-fix-security-vulnerabilities-in-npm-yarn-dependencies/
- fix-npm-vulnerabilities-with-yarn
{
"resolutions": {
"package-merge-lodash-4/*/lodash": "4.17.12"
},
}
...
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
Enter fullscreen mode
Exit fullscreen mode
Fortunately, Gianfranco P. proposed another solution:
1. npm i --package-lock-only
2. npm audit fix
3. rm yarn.lock
4. yarn import
5. rm package-lock.json
Enter fullscreen mode
Exit fullscreen mode
It’s simple, clear and it works. But this script ignores the case of monorepos, because npm
doesn’t support workspaces yet.
There must be another way to generate lock file. It exists! Synp converts yarn.lock
to package-lock.json
and vice versa. So
synp --source-file yarn.lock
Enter fullscreen mode
Exit fullscreen mode
gives package-lock.json
, that contains all the dependencies (nope, but it will be fixed asap. Fixed) of the monorepository. Next npm audit fix
works normally.
However, yarn import
raises an error.
error An unexpected error occurred: "https://registry.yarnpkg.com/workspace-aggregator-bbb13589-b149-4858-b202-4f4e90c33e3f: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/<root>/projects/foobar/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/import for documentation about this command.
Enter fullscreen mode
Exit fullscreen mode
One more side-effect of workspace
field in package.json
. Not a problem. It disappears if you temporarily remove/rename the field before synp
invocation.
Performing these steps manually each time is slightly tedious. Let’s automate.
import fs from 'fs-extra'
import synp from 'synp'
import {join} from 'path'
import findCacheDir from 'find-cache-dir'
import chalk from 'chalk'
import {invoke} from './invoke'
type TContext = { cwd: string, temp: string }
type TCallback = (cxt: TContext) => void
type TStage = [string, ...TCallback[]]
/**
* Prepare temp assets.
* @param {TContext} cxt
* @return {void}
*/
const createTempAssets: TCallback = ({temp}) => {
fs.copyFileSync('yarn.lock', join(temp, 'yarn.lock'))
fs.copyFileSync('package.json', join(temp, 'package.json'))
fs.createSymlinkSync('node_modules', join(temp, 'node_modules'), 'dir')
}
/**
* Remove workspace field from package.json due to npm issue.
* https://github.com/antongolub/yarn-audit-fix/issues/2
* @param {TContext} cxt
* @return {void}
*/
const fixWorkspaces: TCallback = ({temp}) => {
const pkgJsonData = JSON.parse(fs.readFileSync(join(temp, 'package.json'), 'utf-8').trim())
delete pkgJsonData.workspaces
fs.writeFileSync(join(temp, 'package.json'), JSON.stringify(pkgJsonData, null, 2))
}
/**
* Convert yarn.lock to package.json for further audit.
* @param {TContext} cxt
* @return {void}
*/
const yarnLockToPkgLock: TCallback = ({temp}) => {
const pgkLockJsonData = synp.yarnToNpm(temp)
fs.writeFileSync(join(temp, 'package-lock.json'), pgkLockJsonData)
fs.removeSync(join(temp, 'yarn.lock'))
}
/**
* Apply npm audit fix.
* @param {TContext} cxt
* @return {void}
*/
const npmAuditFix: TCallback = ({temp}) =>
invoke('npm', ['audit', 'fix', '--package-lock-only'], temp)
/**
* Generate yarn.lock by package-lock.json data.
* @param {TContext} cxt
* @return {void}
*/
const yarnImport: TCallback = ({temp}) => {
invoke('yarn', ['import'], temp)
fs.copyFileSync(join(temp, 'yarn.lock'), 'yarn.lock')
}
/**
* Apply yarn install to fetch packages after yarn.lock update.
* @param {TContext} cxt
* @return {void}
*/
const yarnInstall: TCallback = ({cwd}) =>
invoke('yarn', [], cwd)
/**
* Clean up temporaries.
* @param {TContext} cxt
* @return {void}
*/
const clear: TCallback = ({temp}) =>
fs.emptyDirSync(temp)
export const stages: TStage[] = [
[
'Preparing temp assets...',
clear,
createTempAssets,
fixWorkspaces,
],
[
'Generating package-lock.json from yarn.lock...',
yarnLockToPkgLock,
],
[
'Applying npm audit fix...',
npmAuditFix,
],
[
'Updating yarn.lock from package-lock.json...',
yarnImport,
yarnInstall,
clear,
],
[
'Done',
],
]
/**
* Public static void main.
*/
export const run = async() => {
const ctx = {
cwd: process.cwd(),
temp: findCacheDir({name: 'yarn-audit-fix', create: true}) + '',
}
for (const [description, ...steps] of stages) {
console.log(chalk.bold(description))
for (const step of steps) step(ctx)
}
}
Enter fullscreen mode
Exit fullscreen mode
And finally it looks to be working.
Any feedback is welcome.
Переустановлена Node.js, Пряжа, Теперь приступим к этой ошибке.
Информация о моей среде:
Узел: v8.12.0
NPM: 6.4.1
Пряжа: 1.10.1
ОС: Windows 10
PS C:UsersmdbelDesktopProjectredux> npx create-react-app learnredux
Creating a new React app in C:UsersmdbelDesktopProjectreduxlearnredux.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.1.tgz: Request failed "404 Not Found"".
info If you think this is a bug, please open a bug report with the information provided in "C:\Users\mdbel\Desktop\Project\redux\learnredux\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd C:UsersmdbelDesktopProjectreduxlearnredux has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
18 окт. 2018, в 22:42
Поделиться
Источник
4 ответа
У меня была такая же проблема, и я решил ее:
Установка последней версии узла, npm и пряжи.
npm install -g [email protected]
nvm install node
npm install -g yarn
Deke
24 окт. 2018, в 23:48
Поделиться
обновление до последней стабильной версии пряжи и удаление папки кэша пряжи в папке AppData решило мою проблему C:UserstestAppDataLocalYarn
raghavendra prasad gudipalli
02 апр. 2019, в 16:04
Поделиться
Я решил эту проблему, удалив файл .yarnrc
из C:UsersyourUserName
ArsTV
31 дек. 2018, в 23:36
Поделиться
Я столкнулся с такой же проблемой при использовании npx
и смог решить эту проблему с помощью следующих шагов:
- Обновлена до последней версии пряжи:
$ npm я @[email protected]
- Удалить папку node_modules
- Удалите пряжу (если она существует).
Если проблема все еще сохраняется, вы можете вместо этого использовать прямую команду: $ yarn create react-app learnredux
yarn create
создается в пряжи 0. 25+
Melchia
18 окт. 2018, в 22:10
Поделиться
Ещё вопросы
- 1код JavaScript работает только один раз, когда страница загружена
- 1Python — большое имя файла RENAME ERROR (ошибка Win 3)
- 1Python указывает вес для линейной регрессии
- 0Возникла исключительная ситуация при выполнении команды ALTER TABLE
- 0Авто Увеличение первичного ключа
- 0Как настроить Grafana на экземпляре EC2, используя аутентификацию IAM для экземпляра RDS mysql?
- 0Перезагрузить страницу, чтобы показать вставленные элементы пользовательского интерфейса jQuery?
- 0C ++ «врезается» в виртуальные функции базовых классов
- 0Поиск поста с несколькими тегами
- 0Обновить CSS при изменении значения для поля выбора
- 1Maven: «javax.json» не включается в «uber» jar через плагин maven-compiler-plugin
- 1Внешний ввод в программу Python во время выполнения
- 1ItemizedOverlay, кажется, рисует с «ломаной» проекцией
- 0стилус: добавьте стиль к идентификатору, который генерируется в JavaScript
- 0массив не привязан для выбора с помощью AngularJs
- 0Структура мобильной страницы Jquery
- 1Разделение MVC Editor для списка объектов
- 0php выдает ошибку no no timezone при новой настройке
- 0PHP: заменить пробелы в конце строки перед вопросом mark_?
- 0Процент изображения не ограничен
- 0весна JPA java.sql. Дата принимает недействительные даты
- 0SQL: объединить несколько таблиц
- 1Синхронизировать две галереи
- 0Как заставить изображение появляться на основе каждого выпадающего меню?
- 1шаги для установки нового приложения Android на новое устройство HTC
- 0Добавление вертикального выравнивания: от среднего до запутанного div
- 1Android: можно обмениваться файлами между разными приложениями?
- 0исходный код CRF одного класса для обнаружения выбросов — C ++
- 1Десериализация DateTime из C # CLR
- 0«Java.lang.UnsatisfiedLinkError: собственный метод не найден:» ошибку можно исправить, если удалить заголовочный файл?
- 0Извлечь изображение YouTube из строки
- 0unlink и DELETE FROM не будут работать
- 1JavaScript RegEx (0-100), но не ведущий 0
- 1Преобразовать объект данных xml webservice в c #
- 0опционально с элементом списка ионов
- 0Разбор файла в базе данных MySQL. Индекс строки вне диапазона
- 0Сравнение Javascript window.location.href с index.php или корневым именем
- 0Как совместить Angular и Rails 4 маршрута
- 1Как вы делаете простой CRUD в Android?
- 0Обновление mysql увеличивается только один раз
- 0jQuery Waypoint — Хотите изменить функцию
- 1«Базовое имя администратора очередей» в Websphere MQ Explorer /
- 1jsPlumb — отрисовка нескольких соединений с использованием одной конечной точки для источника и цели
- 1Чтение текстовых файлов из подпапок и папок и создание кадра данных в пандах для каждого файла текста как одно наблюдение
- 0Ошибка dev c ++: нет соответствия для функции
- 1Ошибка зависимости Hadoop maven — классы Hadoop не найдены
- 1Это правильная конфигурация Kafka Consumer — при этой настройке Kafka?
- 1Угловые ngx-datatable несколько данных в одном столбце
- 1Редактирование сообщений с использованием discord.js не работает
- 0MySQL — Дата — Отметка времени
У меня была аналогичная проблема:
An unexpected error occurred: «https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.0.tgz: Request failed «404 Not Found»».
Удаление yarn.lock и запуск yarn может привести к обновлению большого количества пакетов и, возможно, другим проблемам с конфигурацией.
Вместо этого я просто удалил раздел разрешения es-abstract из yarn.lock, например:
es-abstract@^1.11.0, es-abstract@^1.5.1, es-abstract@^1.7.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.0.tgz#f59d9d44278ea8f90c8ff3de1552537c2fd739b4"
integrity sha512-lri42nNq1tIohUuwFBYEM3wKwcrcJa78jukGDdWsuaNxTtxBFGFkKUQ15nc9J+ipje4mhbQR6JwABb4VvawR3A==
dependencies:
es-to-primitive "^1.2.0"
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.0"
is-callable "^1.1.4"
is-regex "^1.0.4"
object-inspect "^1.6.0"
object-keys "^1.1.1"
string.prototype.trimleft "^2.0.0"
string.prototype.trimright "^2.0.0"
И запустите yarn. Это решило проблему с минимальным количеством обновлений в yarn.lock.
An unexpected error occurred: «https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found»
gitowiec opened this issue 3 years ago · comments
Bug
Trying to run exactly what is said in README.md of this package:
user@computer:~/workspace$ react-native init RNTEST --template react-native-template-typescript
Gives me this error
This will walk you through creating a new React Native project in /home/user/workspace/RNTEST Using yarn v1.17.3 Installing react-native... yarn add v1.17.3 info No lockfile found. [1/4] Resolving packages... warning react-native > create-react-class > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. [2/4] Fetching packages... info fsevents@1.2.9: The platform "linux" is incompatible with this module. info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning "react-native > metro-react-native-babel-transformer@0.54.1" has unmet peer dependency "@babel/core@*". warning " > react-native@0.60.5" has unmet peer dependency "react@16.8.6". [4/4] Building fresh packages... success Saved lockfile. success Saved 391 new dependencies. info Direct dependencies └─ react-native@0.60.5 info All dependencies ├─ @babel/generator@7.6.0 ├─ @babel/helper-builder-binary-assignment-operator-visitor@7.1.0 ├─ @babel/helper-builder-react-jsx@7.3.0 ├─ @babel/helper-call-delegate@7.4.4 ├─ @babel/helper-create-class-features-plugin@7.6.0 ├─ @babel/helper-define-map@7.5.5 ├─ @babel/helper-explode-assignable-expression@7.1.0 ├─ @babel/helper-hoist-variables@7.4.4 ├─ @babel/helper-module-transforms@7.5.5 ├─ @babel/helper-regex@7.5.5 ├─ @babel/helper-remap-async-to-generator@7.1.0 ├─ @babel/helper-wrap-function@7.2.0 ├─ @babel/helpers@7.6.0 ├─ @babel/highlight@7.5.0 ├─ @babel/plugin-external-helpers@7.2.0 ├─ @babel/plugin-proposal-export-default-from@7.5.2 ├─ @babel/plugin-syntax-class-properties@7.2.0 ├─ @babel/plugin-syntax-dynamic-import@7.2.0 ├─ @babel/plugin-syntax-export-default-from@7.2.0 ├─ @babel/plugin-syntax-nullish-coalescing-operator@7.2.0 ├─ @babel/plugin-syntax-object-rest-spread@7.2.0 ├─ @babel/plugin-syntax-optional-catch-binding@7.2.0 ├─ @babel/plugin-syntax-optional-chaining@7.2.0 ├─ @babel/plugin-syntax-typescript@7.3.3 ├─ @babel/plugin-transform-async-to-generator@7.5.0 ├─ @babel/plugin-transform-block-scoped-functions@7.2.0 ├─ @babel/plugin-transform-exponentiation-operator@7.2.0 ├─ @babel/plugin-transform-member-expression-literals@7.2.0 ├─ @babel/plugin-transform-object-assign@7.2.0 ├─ @babel/plugin-transform-object-super@7.5.5 ├─ @babel/plugin-transform-property-literals@7.2.0 ├─ @babel/plugin-transform-react-jsx-source@7.5.0 ├─ @babel/plugin-transform-regenerator@7.4.5 ├─ @babel/plugin-transform-runtime@7.6.0 ├─ @babel/plugin-transform-sticky-regex@7.2.0 ├─ @babel/plugin-transform-typescript@7.6.0 ├─ @babel/plugin-transform-unicode-regex@7.4.4 ├─ @babel/register@7.6.0 ├─ @babel/runtime@7.6.0 ├─ @cnakazawa/watch@1.0.3 ├─ @hapi/address@2.1.2 ├─ @hapi/bourne@1.3.2 ├─ @hapi/joi@15.1.1 ├─ @hapi/topo@3.1.4 ├─ @jest/fake-timers@24.9.0 ├─ @react-native-community/cli-platform-android@2.9.0 ├─ @react-native-community/cli-platform-ios@2.9.0 ├─ @react-native-community/cli@2.9.0 ├─ @types/istanbul-lib-report@1.1.1 ├─ @types/istanbul-reports@1.1.1 ├─ @types/stack-utils@1.0.1 ├─ @types/yargs-parser@13.1.0 ├─ @types/yargs@13.0.2 ├─ abort-controller@3.0.0 ├─ accepts@1.3.7 ├─ ansi-colors@1.1.0 ├─ ansi-cyan@0.1.1 ├─ ansi-escapes@3.2.0 ├─ ansi-fragments@0.2.1 ├─ ansi-gray@0.1.1 ├─ ansi-red@0.1.1 ├─ ansi-regex@4.1.0 ├─ argparse@1.0.10 ├─ arr-flatten@1.1.0 ├─ array-filter@0.0.1 ├─ array-map@0.0.0 ├─ array-reduce@0.0.0 ├─ array-slice@0.2.3 ├─ art@0.10.3 ├─ asap@2.0.6 ├─ assign-symbols@1.0.0 ├─ astral-regex@1.0.0 ├─ async-limiter@1.0.1 ├─ async@2.6.3 ├─ atob@2.1.2 ├─ babel-plugin-dynamic-import-node@2.3.0 ├─ babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0 ├─ balanced-match@1.0.0 ├─ base@0.11.2 ├─ base64-js@1.3.1 ├─ basic-auth@2.0.1 ├─ big-integer@1.6.45 ├─ bplist-creator@0.0.7 ├─ bplist-parser@0.1.1 ├─ brace-expansion@1.1.11 ├─ braces@2.3.2 ├─ bser@2.1.0 ├─ buffer-crc32@0.2.13 ├─ bytes@3.0.0 ├─ cache-base@1.0.1 ├─ caller-callsite@2.0.0 ├─ caller-path@2.0.0 ├─ capture-exit@2.0.0 ├─ chardet@0.4.2 ├─ ci-info@2.0.0 ├─ class-utils@0.3.6 ├─ cli-spinners@2.2.0 ├─ cli-width@2.2.0 ├─ cliui@3.2.0 ├─ clone@1.0.4 ├─ code-point-at@1.1.0 ├─ collection-visit@1.0.0 ├─ color-convert@1.9.3 ├─ color-name@1.1.3 ├─ color-support@1.1.3 ├─ colorette@1.1.0 ├─ commander@2.20.0 ├─ commondir@1.0.1 ├─ compressible@2.0.17 ├─ compression@1.7.4 ├─ concat-map@0.0.1 ├─ concat-stream@1.6.2 ├─ convert-source-map@1.6.0 ├─ copy-descriptor@0.1.1 ├─ core-js@2.6.9 ├─ core-util-is@1.0.2 ├─ cosmiconfig@5.2.1 ├─ create-react-class@15.6.3 ├─ cross-spawn@5.1.0 ├─ dayjs@1.8.16 ├─ debug@2.6.9 ├─ decode-uri-component@0.2.0 ├─ deepmerge@3.3.0 ├─ defaults@1.0.3 ├─ define-properties@1.1.3 ├─ denodeify@1.2.1 ├─ destroy@1.0.4 ├─ dom-walk@0.1.1 ├─ ee-first@1.1.1 ├─ encoding@0.1.12 ├─ end-of-stream@1.4.1 ├─ envinfo@7.3.1 ├─ error-ex@1.3.2 ├─ errorhandler@1.5.1 ├─ esprima@4.0.1 ├─ etag@1.8.1 ├─ event-target-shim@5.0.1 ├─ eventemitter3@3.1.2 ├─ expand-brackets@2.1.4 ├─ external-editor@2.2.0 ├─ extglob@2.0.4 ├─ fancy-log@1.3.3 ├─ fbjs-css-vars@1.0.2 ├─ fbjs-scripts@1.2.0 ├─ figures@2.0.0 ├─ fill-range@4.0.0 ├─ finalhandler@1.1.2 ├─ find-cache-dir@2.1.0 ├─ for-in@1.0.2 ├─ fresh@0.5.2 ├─ fs-extra@7.0.1 ├─ fs.realpath@1.0.0 ├─ function-bind@1.1.1 ├─ get-stream@4.1.0 ├─ get-value@2.0.6 ├─ glob@7.1.4 ├─ global@4.4.0 ├─ growly@1.3.0 ├─ has-symbols@1.0.0 ├─ has-value@1.0.0 ├─ has-values@1.0.0 ├─ hermesvm@0.1.1 ├─ hosted-git-info@2.8.4 ├─ http-errors@1.7.3 ├─ iconv-lite@0.4.24 ├─ image-size@0.6.3 ├─ import-fresh@2.0.0 ├─ imurmurhash@0.1.4 ├─ inflight@1.0.6 ├─ inherits@2.0.4 ├─ inquirer@3.3.0 ├─ invert-kv@1.0.0 ├─ is-accessor-descriptor@1.0.0 ├─ is-arrayish@0.2.1 ├─ is-ci@2.0.0 ├─ is-data-descriptor@1.0.0 ├─ is-descriptor@1.0.2 ├─ is-directory@0.3.1 ├─ is-plain-object@2.0.4 ├─ is-promise@2.1.0 ├─ is-windows@1.0.2 ├─ isarray@1.0.0 ├─ isexe@2.0.0 ├─ jest-get-type@24.9.0 ├─ jest-message-util@24.9.0 ├─ jest-mock@24.9.0 ├─ jest-serializer@24.9.0 ├─ jest-util@24.9.0 ├─ jest-validate@24.9.0 ├─ jest-worker@24.9.0 ├─ jetifier@1.6.4 ├─ js-tokens@4.0.0 ├─ js-yaml@3.13.1 ├─ jsc-android@245459.0.0 ├─ jsesc@2.5.2 ├─ json-parse-better-errors@1.0.2 ├─ json-stable-stringify@1.0.1 ├─ json5@2.1.0 ├─ jsonfile@4.0.0 ├─ kind-of@3.2.2 ├─ klaw@1.3.1 ├─ lcid@1.0.0 ├─ leven@3.1.0 ├─ load-json-file@2.0.0 ├─ locate-path@3.0.0 ├─ lodash@4.17.15 ├─ log-symbols@2.2.0 ├─ logkitty@0.6.1 ├─ loose-envify@1.4.0 ├─ lru-cache@4.1.5 ├─ make-dir@2.1.0 ├─ makeerror@1.0.11 ├─ map-age-cleaner@0.1.3 ├─ map-visit@1.0.0 ├─ mem@1.1.0 ├─ merge-stream@1.0.1 ├─ metro-babel7-plugin-react-transform@0.54.1 ├─ metro-config@0.54.1 ├─ metro-inspector-proxy@0.54.1 ├─ metro-minify-uglify@0.54.1 ├─ metro-react-native-babel-transformer@0.54.1 ├─ metro-source-map@0.55.0 ├─ metro-symbolicate@0.55.0 ├─ metro@0.54.1 ├─ mime-db@1.41.0 ├─ mime-types@2.1.11 ├─ mime@2.4.4 ├─ min-document@2.19.0 ├─ minimatch@3.0.4 ├─ minimist@1.2.0 ├─ mixin-deep@1.3.2 ├─ mkdirp@0.5.1 ├─ morgan@1.9.1 ├─ ms@2.1.2 ├─ mute-stream@0.0.7 ├─ nanomatch@1.2.13 ├─ negotiator@0.6.2 ├─ nice-try@1.0.5 ├─ node-fetch@2.6.0 ├─ node-int64@0.4.0 ├─ node-modules-regexp@1.0.0 ├─ node-notifier@5.4.3 ├─ normalize-package-data@2.5.0 ├─ normalize-path@2.1.1 ├─ number-is-nan@1.0.1 ├─ ob1@0.55.0 ├─ object-assign@4.1.1 ├─ object-copy@0.1.0 ├─ object-keys@1.1.1 ├─ object.assign@4.1.0 ├─ on-headers@1.0.2 ├─ once@1.4.0 ├─ onetime@2.0.1 ├─ open@6.4.0 ├─ options@0.0.6 ├─ ora@3.4.0 ├─ os-locale@2.1.0 ├─ os-tmpdir@1.0.2 ├─ p-defer@1.0.0 ├─ p-is-promise@2.1.0 ├─ p-limit@2.2.1 ├─ p-locate@3.0.0 ├─ p-try@2.2.0 ├─ parse-json@4.0.0 ├─ parse-node-version@1.0.1 ├─ pascalcase@0.1.1 ├─ path-is-absolute@1.0.1 ├─ path-key@2.0.1 ├─ path-parse@1.0.6 ├─ path-type@2.0.0 ├─ pirates@4.0.1 ├─ pkg-dir@3.0.0 ├─ plist@3.0.1 ├─ plugin-error@0.1.2 ├─ posix-character-classes@0.1.1 ├─ pretty-format@24.9.0 ├─ private@0.1.8 ├─ process-nextick-args@2.0.1 ├─ process@0.11.10 ├─ prop-types@15.7.2 ├─ pseudomap@1.0.2 ├─ pump@3.0.0 ├─ range-parser@1.2.1 ├─ react-deep-force-update@1.1.2 ├─ react-devtools-core@3.6.3 ├─ react-is@16.9.0 ├─ react-native@0.60.5 ├─ react-proxy@1.1.8 ├─ read-pkg-up@2.0.0 ├─ read-pkg@2.0.0 ├─ readable-stream@2.3.6 ├─ regenerate-unicode-properties@8.1.0 ├─ regenerator-transform@0.14.1 ├─ regexpu-core@4.6.0 ├─ regjsgen@0.5.0 ├─ regjsparser@0.6.0 ├─ remove-trailing-separator@1.1.0 ├─ repeat-element@1.1.3 ├─ resolve-from@3.0.0 ├─ resolve-url@0.2.1 ├─ resolve@1.12.0 ├─ restore-cursor@2.0.0 ├─ ret@0.1.15 ├─ rimraf@2.7.1 ├─ rsvp@4.8.5 ├─ run-async@2.3.0 ├─ rx-lite-aggregates@4.0.8 ├─ rx-lite@4.0.8 ├─ rxjs@5.5.12 ├─ safer-buffer@2.1.2 ├─ sane@4.1.0 ├─ sax@1.2.4 ├─ scheduler@0.14.0 ├─ semver@5.7.1 ├─ send@0.17.1 ├─ serialize-error@2.1.0 ├─ serve-static@1.14.1 ├─ set-blocking@2.0.0 ├─ set-value@2.0.1 ├─ setprototypeof@1.1.1 ├─ shebang-regex@1.0.0 ├─ shell-quote@1.6.1 ├─ shellwords@0.1.1 ├─ signal-exit@3.0.2 ├─ simple-plist@1.0.0 ├─ slice-ansi@2.1.0 ├─ slide@1.1.6 ├─ snapdragon-node@2.1.1 ├─ snapdragon-util@3.0.1 ├─ source-map-resolve@0.5.2 ├─ source-map-support@0.5.13 ├─ source-map-url@0.4.0 ├─ spdx-correct@3.1.0 ├─ spdx-exceptions@2.2.0 ├─ split-string@3.1.0 ├─ sprintf-js@1.0.3 ├─ stack-utils@1.0.2 ├─ stacktrace-parser@0.1.7 ├─ static-extend@0.1.2 ├─ statuses@1.5.0 ├─ stream-buffers@2.2.0 ├─ string_decoder@1.1.1 ├─ string-width@2.1.1 ├─ strip-ansi@3.0.1 ├─ strip-bom@3.0.0 ├─ supports-color@5.5.0 ├─ symbol-observable@1.0.1 ├─ temp@0.8.3 ├─ throat@4.1.0 ├─ through@2.3.8 ├─ through2@2.0.5 ├─ time-stamp@1.1.0 ├─ tmp@0.0.33 ├─ tmpl@1.0.4 ├─ to-fast-properties@2.0.0 ├─ to-object-path@0.3.0 ├─ to-regex-range@2.1.1 ├─ toidentifier@1.0.0 ├─ trim-right@1.0.1 ├─ type-fest@0.7.1 ├─ typedarray@0.0.6 ├─ uglify-es@3.3.9 ├─ ultron@1.0.2 ├─ unicode-canonical-property-names-ecmascript@1.0.4 ├─ unicode-match-property-ecmascript@1.0.4 ├─ unicode-match-property-value-ecmascript@1.1.0 ├─ unicode-property-aliases-ecmascript@1.0.5 ├─ union-value@1.0.1 ├─ universalify@0.1.2 ├─ unpipe@1.0.0 ├─ unset-value@1.0.0 ├─ urix@0.1.0 ├─ use@3.1.1 ├─ util-deprecate@1.0.2 ├─ utils-merge@1.0.1 ├─ uuid@3.3.3 ├─ validate-npm-package-license@3.0.4 ├─ vary@1.1.2 ├─ walker@1.0.7 ├─ wcwidth@1.0.1 ├─ whatwg-fetch@3.0.0 ├─ which@1.3.1 ├─ write-file-atomic@1.3.4 ├─ xcode@2.0.0 ├─ xmlbuilder@9.0.7 ├─ xmldoc@1.1.2 ├─ xmldom@0.1.27 ├─ xpipe@1.0.5 ├─ xtend@4.0.2 ├─ y18n@3.2.1 └─ yargs-parser@7.0.0 Done in 5.66s. info Setting up new React Native app in /home/user/workspace/RNTEST info Fetching template react-native-template-react-native-template-typescript... yarn add v1.17.3 [1/4] Resolving packages... warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart() error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found". info If you think this is a bug, please open a bug report with the information provided in "/home/user/workspace/RNTEST/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. yarn remove v1.17.3 [1/2] Removing module react-native-template-react-native-template-typescript... error This module isn't specified in a package.json file. info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command. warn Failed to clean up template temp files in node_modules/react-native-template-react-native-template-typescript. This is not a critical error, you can work on your app. (node:9290) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript at makeError (/home/user/workspace/RNTEST/node_modules/execa/index.js:174:9) at Promise.all.then.arr (/home/user/workspace/RNTEST/node_modules/execa/index.js:278:16) at process._tickCallback (internal/process/next_tick.js:68:7) (node:9290) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) (node:9290) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. user@latitude:~/workspace$ react-native init RNTEST --template react-native-template-typescript
Environment info
React native info output:
warn Package react has been ignored because it contains invalid configuration. Reason: Cannot find module 'react/package.json' warn Package @react-native-community/eslint-config has been ignored because it contains invalid configuration. Reason: Cannot find module '@react-native-community/eslint-config/package.json' warn Package babel-jest has been ignored because it contains invalid configuration. Reason: Cannot find module 'babel-jest/package.json' warn Package jest has been ignored because it contains invalid configuration. Reason: Cannot find module 'jest/package.json' warn Package react-test-renderer has been ignored because it contains invalid configuration. Reason: Cannot find module 'react-test-renderer/package.json' info Fetching system and libraries information... System: OS: Linux 5.1 Ubuntu 18.04.3 LTS (Bionic Beaver) CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Memory: 8.61 GB / 15.56 GB Shell: 4.4.20 - /bin/bash Binaries: Node: 10.16.2 - ~/.nvm/versions/node/v10.16.2/bin/node Yarn: 1.17.3 - /usr/bin/yarn npm: 6.11.3 - ~/.nvm/versions/node/v10.16.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.2 System Images: android-28 | Google Play Intel x86 Atom_64 Android NDK: 20.0.5594570 npmPackages: react-native: 0.60.5 => 0.60.5 npmGlobalPackages: react-native-cli: 2.0.1
Library version: 0.60.5
Steps To Reproduce
- proceed with official getting started guide for RN (React Native CLI Quickstart)
- try to init TS template
…
Describe what you expected to happen:
- should not crash
Reproducible sample code
I have no code, it is not related to this issue
Please read readme and how to use this template.
For future users here is what I omitted reading README.md
, and what is crucial to use this template
You may need to remove the globally installed react-native-cli (npm uninstall -g react-native-cli), for the above command to work. The global react-native-cli is deprecated, and no longer supported.
remove legacy react-native-cli
npm uninstall -g react-native-cli
install new thing
npm i -g @react-native-community/cli
and you can new project with react-native-template-typescript
npx react-native init MyApp --template react-native-template-typescript
Pow cara, Deus abençoe sua vida, já tava desesperado com esse bug, coisa de iniciante….kkkkk…valeu
error Error: Command failed: yarn add react-native@latest
error An unexpected error occurred: «https://registry.yarnpkg.com/react-native: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND host».
This error show after create new project
Exactly the same. When starting doing an init with the ts template, I get
error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found".
Note the react-native-template prefix.
--template typescript
Does work. This is not what’s in the documentation. Also, —template without template name to list templates is broken, but that’s for react-native-community/cli:
(node:94561) UnhandledPromiseRejectionWarning: TypeError: template.includes is not a function
@jrz check for fixes in this issue #80. You probably have wrong cli installed
Hmm.. ok. I did install the latest version (I have multiple node versions managed by nodenv, and because it does know the cli available somewhere, it’ll return a message about that rather than not-found).
Afterwards, I removed all cli’s from all versions.. I’ll have to upgrade old projects someday anyway. Still didn’t work, as I removed the cli’s in a separate terminal. Had to close / nodenv rehash in or to pick it up.
Can you try adding the —ignore-existing flag
npx —ignore-existing react-native init MyApp —template react-native-template-typescript
Best solution I found
Remove
npm uninstall -g react-native-cli
Create the folder where the project will be
mkdir [folder name] && cd [folder name]
Install the dependencies and everything will work
yarn init
yarn add react-native
yarn react-native init [Project Name] ...
This didn’t work for me npm uninstall -g react-native-cli
then I remembered that I used yarn 😅 so for reference
yarn global remove react-native-cli
then installing the correct one
yarn global add @react-native-community/cli
then creating a new project should work
First, remove react-native-cli
npm uninstall -g react-native-cli
Second, install @react-native-community/cli
npm i -g @react-native-community/cli
Third, with this I should able to create react native project using typescript tempalate
npx react-native init MyApp --template react-native-template-typescript
Fourth, for run existing project or old react native project
npx react-native start
npx react-native run-android / npx react-native run-ios
remove legacy react-native-cli
npm uninstall -g react-native-cli
install new thing
npm i -g @react-native-community/cli
and you can new project with react-native-template-typescript
npx react-native init MyApp --template react-native-template-typescript
Thanks .. it work!!!
Updating the node
& npm
version helped me. If it doesn’t help try updating yarn
, perhaps it would resolve the issue.