Yarn encounters 404 error installing local and remote packages for specific project folder - yarnpkg

I'm encountering the following message when installing packages:
YN0001: │ HTTPError: Response code 404 (Not Found)
at se.<anonymous> (C:\Code\.yarn\releases\yarn-berry.cjs:23:10082)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
This happens for both a local package using yarn add ../my-package or remote package (testing using yarn add lodash).
When I'm in another project on the same computer, the package is installed fine. What could be causing this?

This could be that a yarn link has been deleted. When making the symlink using yarn link, a resolutions field is added in package.json. Just having this link however is not adequate.

Related

Vercel won't build Gatsby site because of missing 404 page

I'm working on a Gatsby site that's hosted on Vercel. It runs fine locally but when I push it to Vercel the build breaks with the error message "error An unexpected error occurred: "https://registry.yarnpkg.com/#user/dom/-/dom-0.0.11.tgz: Request failed \"404 Not Found\"". Full log is included below.
When I first encountered the error, the src/pages/404.js file was indeed missing. So therefore I created it, as a standard functional component, no special features.
When I run the 404-preview from the dev version (localhost:8000/randomstring) it shows up fine. And when I try building it locally gatsby build, it succeeds :
│ └ /something/
└ src/pages/404.js
├ /404/
└ /404.html
I've tried creating new Vercel projects, also from a different account, with the same result. I've not found any other post containing this issue.
Here is the complete build log:
[16:16:00.967] Retrieving list of deployment files...
[16:16:02.582] Downloading 60 deployment files...
[16:16:04.867] Installing build runtime...
[16:16:06.018] Build runtime installed: 1.151s
[16:16:06.063] Installing build runtime...
[16:16:08.203] Build runtime installed: 2.139s
[16:16:09.140] Looking up build cache...
[16:16:09.351] Looking up build cache...
[16:16:09.622] Build Cache not found
[16:16:09.848] Build Cache not found
[16:16:09.957] Detected package.json
[16:16:09.958] Installing dependencies...
[16:16:10.305] yarn install v1.22.17
[16:16:10.437] [1/4] Resolving packages...
[16:16:10.490] Installing dependencies...
[16:16:11.187] [2/4] Fetching packages...
[16:16:13.099] error An unexpected error occurred: "https://registry.yarnpkg.com/#myverceluser/dom/-/dom-0.0.11.tgz: Request failed \"404 Not Found\"".
[16:16:13.100] info If you think this is a bug, please open a bug report with the information provided in "/vercel/path2/yarn-error.log".
[16:16:13.100] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[16:16:47.226] Error: Command "yarn install" exited with 1
[16:16:47.441] yarn install v1.22.17
[16:16:47.552] [1/4] Resolving packages...
[16:16:48.313] [2/4] Fetching packages...
[16:16:48.946] error An unexpected error occurred: "https://registry.yarnpkg.com/#myverceluser/utils/-/utils-0.0.5.tgz: Request failed \"404 Not Found\"".
[16:16:48.946] info If you think this is a bug, please open a bug report with the information provided in "/vercel/path1/yarn-error.log".
[16:16:48.947] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[16:16:49.494] Error: Command "yarn install" exited with 1
Any insight would be deeply appreciated. Let me know if I've left some vital information out and I'll add it.
Thanks.
I think it's not that your 404 page is missing - doesn't the framework provide a default?
But rather that it can't fetch this package,
% curl https://registry.yarnpkg.com/#user/dom/-/dom-0.0.11.tgz
{"error":"Not found"}
Is it this https://yarnpkg.com/package/dom? That doesn't have version 0.0.11.

Yarn errors when running (context: Setting up WunderGraph GraphQL instance)

Context:
I am attempting to run the demo from Wundergraph on a work computer. When I get to installing Wundergraph with Yarn, it fails. The Wundergraph error is.
Internal Error: Error when performing the request
at ClientRequest.<Anonymous> (C:Users\{user name here}\AppData\Roaming\npm\node_modules\corepack\dist\corepack.js :3927:20)
at ClientRequest.emit (noe:events:390:28)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:20)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
With the socket issue, I am guessing there is a proxy or some other security issue on the client computer. I have successfully run the following on a separate, personal computer:
yarn global add #wundergraph/wunderctl#latest
No variation of yarn commands work on the work, computer (fails with any of the following):
yarn
yarn global add #wundergraph/wunderctl#latest
To eliminate possibilities:
On my local machine, yarn will not properly add path to wunderctl, which means searcing out the .exe to get the samples installed. This is a minor oversight in the demo, as the demo now works.
Does not matter if the command prompt is run as me or as administrator. It fails either way.
Fails on VPN and off, so VPN not the issue.
I can get things installed with NPM, but that appears to successfully install the .js files from Wundergraph and not the .exe. I am thinking this might be a clue.
I am going to work with others who say they have it installed and see how they did it, but that won't happen until next week. As I am contract and they are employees, it could end up being additional restrictions.
As this does it with yarn, as well as yarn {install command here}, I am guessing it is some check yarn does every time, or permissions on the yarn files themselves.
I know this is a long shot, but hoping someone encountered this and has found a way down the Rabbit Hole and then back out of wonderland. My fear is having to go full manual, edit the sample files heavily to eradicate yarn (for npm, most likely), have to wait until Wundergraph goes open source and grab the bits, work strictly from command line, or all of the above.
I have done a lot of searching for an answer before coming here.
I had the same problem with another package, with exactly the same error call stack.
First I updated NodeJS to the latest stable version 16.13.1 (I had 14.16.0). After that yarn showed signs of life:
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
But then it failed with
RequestError: connect ETIMEDOUT {ip address}:443
at ClientRequest.<anonymous> (node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (node:events:510:26)
at ClientRequest.emit (node:events:402:35)
at ClientRequest.origin.emit (node_modules\got\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
That ip address was indeed unreachable due to a routing problem, after I fixed that all went well.

`npm install` issues/failure with expo-cli and react-native-app

I really need some help with what seems to be the most basic task (setting up the expo/react-native project). I've installed the expo-cli (v3.11.7), react-native (v2.0.1), watchman (v4.9.0) and node (v12.14.1). I've followed the tutorial up until the point where I need to run expo start and I get the following error:
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older.
Error: node_modules directory is missing. Please run npm install in your project directory.
Couldn't start project. Please fix the errors and restart the project.
Set EXPO_DEBUG=true in your env to view the stack trace.
I've then run npm install and tried again but the same error pops up. I've removed the node_modules folder and that didn't work either.
Update:
When I npm install this is the error I'm seeing:
npm WARN deprecated core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://codeload.github.com/expo/react-native/tar.gz/sdk-36.0.0 failed, reason: write EPROTO 4521895360:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 40
I've installed yarn (v1.21.1) and tried installing using this with the same error:
warning expo > fbemitter > fbjs > core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
error An unexpected error occurred: "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz: write EPROTO 4356277696:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 40
Can anyone advise?
I've managed to solve the problem. I was trying to install over my home network, which apparently has some proxy restrictions! No idea why.
Someone advised me to try again but connected to another network or my mobile hotspot. I tried this and it worked! Problem solved. So I guess for any others that may be experiencing the same problem, try connecting to another network and see if that helps.
If this fails, then I suppose looking at the proxy configuration and making changes there may help. But I wouldn't advise doing this unless you know exactly what you're doing.

Angular e2e testing without chromedriver

I am working on angular application e2e tests in very closed and secure environment, where it is not allowed to install chromedriver. It is Windows 7 with IE11 installed.
Command:
npm install chromedriver --save-dev
results with:
> chromedriver#2.31.0 install C:\_LocalWorkspace\Projects\SomeProject\node_modules\chromedriver
> node install.js
Downloading https://chromedriver.storage.googleapis.com/2.31/chromedriver_win32.zip
Saving to C:\Users\someuser\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
ChromeDriver installation failed Error with http request: Error: connect ETIMEDOUT 172.217.21.208:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN app#0.0.1 No repository field.
npm ERR! Windows_NT 6.1.7601
What are my options for e2e tests in this circumstances?
EDIT1:
The problem can be described in other words. The environment that I am working in is closed for direct binary downloading. I am working for a client that has such policy and I can not do anything about that. I am also not allowed to install chrome browser so I have to use internet explorer. Therefore, only available webdrivr is iedriver. ( Please correct me if I am wrong )
My main problem is to install all requirements to make protractor works. It is like I have no Internet connection, but just for binaries. Most of the npm dependencies can be installed normally.
Like:
npm instal webdriver-manager which works,
but
node ./node_modules/protractor/bin/webdriver-manager update fails to download these three files:
https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
https://chromedriver.storage.googleapis.com/2.26/chromedriver_win32.zip
https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-win64.zip
I have an option (from the client) to download files in isolated environment let them through security check and then use them. I did that and I have placed those 3 files in SomeProject\node_modules\protractor\node_modules\webdriver-manager\selenium directory.
Then I have tried to run node ./node_modules/protractor/bin/webdriver-manager update again, hoping that it will skip the download and continue with the normal process steps, extracting etc. But it did not, again it failed to download with the same message.
Then I have extracted the zip files manually.
At this point I am not sure, does node ./node_modules/protractor/bin/webdriver-manager update need to do more things than downloading and extracting. Because it has terminated on download, and I did it manually but how can I know what it would do after if the download was successful?
Anyway, I tried npm run e2e command (which is starting my protractor tests) with extracted binaries in place.
The result was:
[13:24:07] I/local - Starting selenium standalone server...
[13:24:07] I/launcher - Running 1 instances of WebDriver
[13:24:11] I/local - Selenium standalone server started at http://53.150.192.128:58001/wd/hub
[13:24:11] E/launcher - The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://sel
enium-release.storage.googleapis.com/index.html
From error message it is clear that I should download the latest version of iedriver from here as it is described here
I have chosen the latest version, currently 3.4
http://selenium-release.storage.googleapis.com/index.html?path=3.4/
that looks like this:
I took the first link IEDriverServer_Win32_3.4.0.zip downloaded it and extract it in SomeProject\node_modules\protractor\node_modules\webdriver-manager\selenium
But the problem with the same error message still exists. Am I placing it in correct target directory? Should I download maybe some other file from the image?
Please advise how can I install iedriever and run protractor tests.
EDIT2:
Also, the problem can be generalized and put like. How to install protractor dependencies by downloading them manually?

Swagger-editor running locally shows empty page

I am new to swagger.
I have created APIs in django-rest-framework. I want to document them. Hence reading about swagger.
I tried django-rest-swagger but because of lack of documentation I could not make my code suitable for documentation.
Hence I am trying swagger editor which will allow me to design API structure from scratch. I have installed it locally but it is showing me empty page at "127.0.0.1:9000". what should I do now ?
I want to write YAML or JSON file that will be consumed by swagger-editor installed locally. How can I achieve this ?
This is the error on console when I load 127.0.0.1:9000
Warn: could not find module util
http://127.0.0.1:9000/bower_components/angular-schema-form/dist/schema-form.js Failed to load resource: the server responded with a status of 404 (Not Found)
angular.js:80 Uncaught Error: [$injector:nomod] Module 'schemaForm' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.2/$injector/nomod?p0=schemaForm
angular.js:80 Uncaught Error: [$injector:modulerr] Failed to instantiate module PhonicsApp due to:
Error: [$injector:modulerr] Failed to instantiate module schemaForm due to:
Error: [$injector:nomod] Module 'schemaForm' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
I'm not exactly sure what is the problem here. As a general note, you can always clean up npm and Bower modules and start from clean state again.
npm cache clean
rm -rf node_modules
npm install
bower cache clean
rm -rf app/bower_components
bower install
npm start
I was having the same problem.
Previously my node version was the latest v6
I reinstalled everything and then install v4.4.4
node --v
make sure it's v4.4.4
npm install -g http-server
wget https://github.com/swagger-api/swagger-editor/releases/download/v2.10.1/swagger-editor.zip
unzip swagger-editor.zip
http-server
don't use http-server swagger-editor

Resources