Can't build expro project - react-native

I would like to create react native project using expo
but get fail.... anyone knows how to solve it???
request to https://registry.npmjs.org/expo-template-blank failed, reason: connect ETIMEDOUT 104.16.16.35:443
but using react-native-cli is work for me, not work with expo...
expo init app
Choose a template: » blank a minimal app as clean as an empty canvas
request to https://registry.npmjs.org/expo-template-blank failed, reason: connect ETIMEDOUT 104.16.19.35:443
FetchError: request to https://registry.npmjs.org/expo-template-blank failed, reason: connect ETIMEDOUT 104.16.19.35:443
at ClientRequest.<anonymous> (C:\Users\Me\AppData\Roaming\npm\node_modules\expo-cli\node_modules\minipass-fetch\lib\index.js:97:14)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:327:22)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

Finally,I have no idea to run "expo init app" to create project....
so, I go to https://snack.expo.io/
create and download the project.
then go to the project's root directory.
Then use these commands:
npm install -g expo-cli
npm install
expo start
It work fine!

Related

Heroku Deployment Error: npm ERR! Host key verification failed. NextJS/ExpressJS App

I am attempting to deploy my Next.js/Express,js backend app to Heroku via GitHub, however, I keep receiving the following error:
If anyone can please help me resolve this issue, that would be highly appreciated!
Thanks.
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 14.x...
Downloading and installing node 14.17.5...
Using default npm version: 6.14.14
-----> Installing dependencies
Installing node modules
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git#github.com/securedeveloper/js-xlsx.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.ScCS4/_logs/2021-08-22T17_21_36_340Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I don't know if this is a good solution, but after removing package-lock.json and pushing again the error disappeared

Why is my pre-built cloud foundry node app trying to fetch modules that are already in node_modules?

I have a pre-built node app that must not attempt to access the network if npm install is run prior to startup - the intent is for everything to already be present in the node_modules directory. It is being deployed in a cloud foundry environment.
This is not a proxy problem - there must be no attempt to access registry url's during cloud foundry app staging. I'm looking for ideas why it's trying to do this.
When this app is deployed to cloud foundry, even though it detects the presence of the node_modules directory during staging, it still tries to retrieve basic dependency modules (like #node/types) that are already present in node_modules, and of course it times out trying to reach a registry that is not permitted in these environments. There are hundreds of other dependencies that it does not attempt to retrieve, but for some reason it thinks it does need some modules. For example:
2021-03-17T16:29:57.71-0700 [STG/0] OUT Installing any new modules (package.json + package-lock.json)
2021-03-17T16:32:31.78-0700 [STG/0] OUT npm ERR! code ECONNREFUSED
2021-03-17T16:32:31.78-0700 [STG/0] OUT npm ERR! errno ECONNREFUSED
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! FetchError: request to https://<registry-fqdn>/#types%2flong failed, reason: connect ECONNREFUSED 10.x.x.x:443
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at ClientRequest.<anonymous> (/tmp/contents784086672/deps/0/node/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at ClientRequest.emit (events.js:315:20)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at TLSSocket.socketErrorListener (_http_client.js:469:9)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at TLSSocket.emit (events.js:315:20)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at emitErrorNT (internal/streams/destroy.js:106:8)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at processTicksAndRejections (internal/process/task_queues.js:80:21)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! FetchError: request to https://<registry-fqdn>/#types%2flong failed, reason: connect ECONNREFUSED 10.x.x.x:443
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at ClientRequest.<anonymous> (/tmp/contents784086672/deps/0/node/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at ClientRequest.emit (events.js:315:20)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at TLSSocket.socketErrorListener (_http_client.js:469:9)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at TLSSocket.emit (events.js:315:20)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at emitErrorNT (internal/streams/destroy.js:106:8)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! at processTicksAndRejections (internal/process/task_queues.js:80:21) {
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! type: 'system',
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! errno: 'ECONNREFUSED',
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! code: 'ECONNREFUSED',
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! parent: 'app'
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! }
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR!
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! If you are behind a proxy, please make sure that the
2021-03-17T16:32:31.79-0700 [STG/0] OUT npm ERR! 'proxy' config is set properly. See: 'npm help config'
2021-03-17T16:39:12.54-0700 [STG/0] OUT npm ERR! A complete log of this run can be found in:
2021-03-17T16:39:12.54-0700 [STG/0] OUT npm ERR! /home/vcap/.npm/_logs/2021-03-17T23_32_31_800Z-debug.log
2021-03-17T16:39:12.56-0700 [STG/0] OUT **ERROR** Unable to build dependencies: exit status 1
2021-03-17T16:39:13.07-0700 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14
2021-03-17T16:39:13.09-0700 [STG/0] OUT Exit status 223
2021-03-17T16:39:13.28-0700 [STG/0] OUT Cell 5cee670a-6f6c-4510-a274-5584f197038c stopping instance 59dda306-be2f-4d08-830c-77c08ffab3f5
2021-03-17T16:39:13.28-0700 [STG/0] OUT Cell 5cee670a-6f6c-4510-a274-5584f197038c destroying container for instance 59dda306-be2f-4d08-830c-77c08ffab3f5
2021-03-17T16:39:13.76-0700 [API/1] ERR Failed to stage build: staging failed
Any ideas?
Edit #1
Other facts:
the app is pushed as a zip archive
the zip file system includes the node_modules directory resulting from an npm install command run during the "build" to construct the zip
the zip file system includes package-lock.json (from source)
there is no .cfignore file anywhere in the zip archive
the zip 'build' used to be taking place on a windows machine, and did not previously have this problem when subsequently pushed to cf
the zip 'build' recently migrated to a gitlab ci runner from a k8s cluster, which may be using a centos-derived image
the buildpack version is 1.7.32
the version of node (14.14.0) on the build machine matches the version used by the buildpack, but the npm version (7.6.1) does not (buildpack uses 6.14.8)
changing the build image where the zip is assembled to Ubuntu Bionic Beaver (18.04.4 LTS) makes no difference
Not 100% sure this will resolve the issue, but here's what I've seen commonly trip people up trying to vendor Node.js dependencies:
First, review the instructions from the docs: https://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
Run npm install (you've done this)
Make sure you have a package-lock.json file (you probably have this). That locks in the versions to use and should guarantee what's in node_modules/ matches what will be installed. If you don't have this, you'll see Warning: package-lock.json not found. output from the buildpack.
Make sure you're pushing up package.json, package-lock.json, and the full node_modules/ directory, along with all your application code.
These are not documented, but some tips from what I've observed working with others on this:
Make sure you don't have a .cfignore file, as that could accidentally cause node_modules/ to not be pushed. You can typically tell if node_modules/ is not being pushed because the number of files & size of what is being pushed will be much, much larger with this. You will also see the message It is recommended to vendor the application's Node.js dependencies if the node_modules/ directory doesn't exist.
When you run npm install locally, you need to be running it in an Ubuntu Bionic VM or container. This is because NPM will often install modules that require native code. It will automatically handle this, but what's in node_modules/ is specific for the OS & architecture where you run npm install. Thus If you run npm install on a non-Ubuntu Bionic OS (say Windows or MacOS), it will compile the native code for your local machine. When you push this up, it won't match and NPM will try to reinstall the package which can trigger access to the Internet.
Make sure you're using the latest Node.js buildpack & Node.js version as possible. It always helps to have the latest code with bug fixes.
NODE_ENV=production will be set by the buildpack, and this can sometimes cause difference in behavior. It also skips installing dev dependencies. Not likely the issue here, but worth mentioning as this trips up some people.
This problem turned out to be caused by mismatched npm versions on the machine where the package-lock.json file is generated, the machine where the node_modules directory is populated for inclusion in the zip distribution (npm v7.x), and what the cloud foundry build pack is using (npm v6.x).
Changing the dev and build machines to use npm v6.x to generate both the package-lock.json file and populate the node_modules directory resulted in a successfully-vendored nodejs app.

(npm error) when creating Vue-CLI project

Basically I am trying to create a new Vue-CLI project. However, there is a npm error alert at the very end of the creation:
Vue CLI v4.5.11
✨ Creating project in C:\Eric\apps\vueproj\modal-project.
🗃 Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Eric\AppData\Roaming\npm-cache\_logs\2021-02-05T07_09_25_978Z-debug.log
How can I solve it? Please help me on this...

Error installing React Native: request to https://registry.npmjs.org/yallist failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

I am installing React Native by running the following command:
sudo npm install -g create-react-native-app
but I am getting the following error:
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/yallist failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! A complete log of this run can be found in:
npm ERR! /home/zeusx/.npm/_logs/2017-08-16T05_07_19_737Z-debug.log
How can I fix it?
Install react native cli using
npm install -g react-native-cli
Then create project using
react-native init "ProjectName"
run using react-native run-android or react-native run-ios

Error when using 'create-react-native-app'

I tried to create a new React Native app using the command create-react-native-app in the node.js terminal on my Windows system. I got the following terminal error:
D:\project>create-react-native-app crna
Creating a new React Native app in D:\project\crna.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Suppor
t
npm WARN deprecated #exponent/spawn-async#1.2.8: Please switch to #expo/spawn-as
ync, the new name of this package. It's the same code with our new name.
npm ERR! shasum check failed for C:\Users\ui-admin\AppData\Local\Temp\npm-3204-a
eacedd1\registry.npmjs.org\_40exponent\ngrok\-\ngrok-2.2.7.tgz
npm ERR! Expected: 37fe66f922b1003da2a78c66b7d4d3bc9313e423
npm ERR! Actual: d134060eb730b880da06d5c040ca933f6a75b613
npm ERR! From: https://registry.npmjs.org/#exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ui-admin\AppData\Roaming\npm-cache\_logs\2017-05-26T09_36_
04_379Z-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed
Anyone met this error or fix it?
I got the same error, though in RubyMine, which provided the response that react-native doesn't work with npm 5 yet. it said you can either revert to npm 4 or feel free to log an issue here: https://github.com/npm/npm/issues/16991
I think you're best bet would be to revert and wait it out!