react-native init AwesomeProject hang - react-native

I'm new with react, I"m trying to init withreact-native init AwesomeProject but after a few minutes looks like the react is hang
npm verb addTmpTarball already have metadata; skipping unpack for babylon#5.8.35
npm verb correctMkdir /Users/dramirez/.npm correctMkdir not in flight; initializing
npm verb afterAdd /Users/dramirez/.npm/babylon/5.8.35/package/package.json not in flight; writing
npm verb correctMkdir /Users/dramirez/.npm correctMkdir not in flight; initializing
npm verb afterAdd /Users/dramirez/.npm/babylon/5.8.35/package/package.json written
npm http fetch 200 https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz
npm verb addTmpTarball /var/folders/kr/js5391j510v9962s56x6c9rw0000gn/T/npm-22068-e178ea9f/registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz not in flight; adding
npm verb addTmpTarball already have metadata; skipping unpack for bluebird#2.10.2
npm verb correctMkdir /Users/dramirez/.npm correctMkdir not in flight; initializing
npm verb afterAdd /Users/dramirez/.npm/bluebird/2.10.2/package/package.json not in flight; writing
npm verb correctMkdir /Users/dramirez/.npm correctMkdir not in flight; initializing
npm verb afterAdd /Users/dramirez/.npm/bluebird/2.10.2/package/package.json written
loadDep:try-resolve → net ▌ ╢███████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
I'm not in china and I'm not sure what to do?

Does it always hang on the same package? There is an option you can pass to react-native start, I think its reset-cache, maybe that will help

After a few hours I decided to restart the computer and start the process again, and now it is working ;-( this is annoying

try this :
react-native init ProjectName --verbose
it worked for me .

VPN will solve that problem; according to my experiences. Maybe that's because of internet connection issue..

Related

Getting Bad Request (Http 400) when using npm dist-tag with Nexus 3.19.1-01

We are running Nexus OSS 3.19.1-01 (CentOS7 with OpenJdk 1.8.0_222-b10) with npm repository. Everything works fine except the npm dist-tag feature which should now work with version >3.19.
$ npm publish <pkg> --tag bla #--> works
$ npm install <pkg>#bla #--> works
$ npm dist-tag ls <pkg> #--> works
$ npm dist-tag rm --verbose #myscope/mypackage foo
npm info it worked if it ends with ok
npm verb cli [
npm verb cli '/usr/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'dist-tag',
npm verb cli 'rm',
npm verb cli '--verbose',
npm verb cli '#myscope/mypackage',
npm verb cli 'foo'
npm verb cli ]
npm info using npm#6.13.1
npm info using node#v12.13.0
npm verb npm-session 3b193197390df1cf
npm verb dist-tag del snapshot from #myscope/mypackage
npm http fetch GET 200 https://nexus.example.com/repository/npm-group/-/package/#myscope%2fmypackage/dist-tags 1396ms
npm http fetch DELETE 400 https://nexus.example.com/repository/npm-group/-/package/#myscope%2fmypackage/dist-tags/foo 9ms
npm verb stack Error: 400 Bad Request - DELETE https://nexus.example.com/repository/npm-group/-/package/#myscope%2fmypackage/dist-tags/foo
npm verb stack at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb statusCode 400
npm verb pkgid #myscope/mypackage#latest
npm verb cwd /home/myname/path-to-code/mypackage/client
npm verb Linux 5.3.11-300.fc31.x86_64
npm verb argv "/usr/bin/node" "/usr/local/bin/npm" "dist-tag" "rm" "--verbose" "#myscope/mypackage" "foo"
npm verb node v12.13.0
npm verb npm v6.13.1
npm ERR! code E400
npm ERR! 400 Bad Request - DELETE https://nexus.example.com/repository/npm-group/-/package/#myscope%2fmypackage/dist-tags/foo
npm verb exit [ 1, true ]
npm timing npm Completed in 1730ms
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myname/.npm/_logs/2019-11-20T13_02_41_234Z-debug.log
$ npm dist-tag add #myscope/mypackage#0.1.0 bar
# did not work, same error as above
No additional log messages in nexus log.
Any idea?
I'm afraid it won't work for you, because you're running your commands against npm group repository. Both npm dist-tag add and npm dist-tag rm work only for hosted repositories as of NXRM 3.19.1. However, npm dist-tag ls is supported by all types of repositories (since 3.19.0).

Nuxt.js: fsevents is not a constructor

I'm using MacOS Mojave 10.14.5. When I run 'npm run dev' command where the nuxt starter package is located, I have 'fsevents' error, and the server doesn't work.
I already reinstall node and npm several times, but it doesn't work.
Here's an error:
/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:28
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:28:11)
at setFSEventsListener (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:82:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:252:16)
at FSWatcher.<anonymous> (/Users/kimgyun/Desktop/nuxt_test_folder/nuxt_test_b/node_modules/watchpack/node_modules/chokidar/lib/fsevents-handler.js:386:25)
at LOOP (fs.js:1570:14)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nuxt_test_b#1.0.0 dev: `nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nuxt_test_b#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kimgyun/.npm/_logs/2019-06-06T02_11_18_374Z-debug.log
How can I run this nuxt.js server without this error?
It's a problem with fs events, and a rather annoying one at that. Specifically this happens when you're using Node 12.
You'll need to install fsevents#1.2.9 explicitly:
npm i fsevents#1.2.9 -D
or
yarn add fsevents#1.2.9 -D
This should work for you at this point.

Npm install : FetchError: request to http://registry.npmjs.org/... failed, reason: read ECONNRESET

Trying to install any node package using npm hangs for about 5 mins then gives a ECONNRESET network error. I have been using npm for other projects recently and it worked fine but now will not work for any project(Including clean npm init)
npm i ws
This is on a Raspberry pi 3 running on my home network with no proxy requirements. All other machines both linux and windows are working fine.
npm -v = 6.4.1
I have tried the following:
npm i ws This gives me the ECONNRESET error (See below)
Curl https://registry.npmjs.org/
& Curl https://registry.npmjs.org/ws
Both return the correct json response
Removing any proxy settings
npm config rm proxy
npm config rm https-proxy
npm config set registry http://registry.npmjs.org/
Restarting etc
Full Error log:
npm i ws --save --verbose
npm info it worked if it ends with ok
npm verb cli [ '/home/pi/.nvm/versions/node/v8.16.0/bin/node',
npm verb cli '/home/pi/.nvm/versions/node/v8.16.0/bin/npm',
npm verb cli 'i',
npm verb cli 'ws',
npm verb cli '--save',
npm verb cli '--verbose' ]
npm info using npm#6.4.1
npm info using node#v8.16.0
npm verb npm-session 0a9bedb5def7f4a1
npm timing stage:rollbackFailedOptional Completed in 6ms
npm timing stage:runTopLevelLifecycles Completed in 1146975ms
npm verb type system
npm verb stack FetchError: request to http://registry.npmjs.org/ws failed, reason: read ECONNRESET
npm verb stack at ClientRequest.req.on.err (/home/pi/.nvm/versions/node/v8.16.0/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm verb stack at emitOne (events.js:116:13)
npm verb stack at ClientRequest.emit (events.js:211:7)
npm verb stack at Socket.socketErrorListener (_http_client.js:401:9)
npm verb stack at emitOne (events.js:116:13)
npm verb stack at Socket.emit (events.js:211:7)
npm verb stack at emitErrorNT (internal/streams/destroy.js:66:8)
npm verb stack at _combinedTickCallback (internal/process/next_tick.js:139:11)
npm verb stack at process._tickCallback (internal/process/next_tick.js:181:9)
npm verb cwd /home/pi/projects/picamera/node_server
npm verb Linux 4.19.37-v7+
npm verb argv "/home/pi/.nvm/versions/node/v8.16.0/bin/node" "/home/pi/.nvm/versions/node/v8.16.0/bin/npm" "i" "ws" "--save" "--verbose"
npm verb node v8.16.0
npm verb npm v6.4.1
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to http://registry.npmjs.org/ws failed, reason: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm verb exit [ 1, true ]
npm timing npm Completed in 1148813ms
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-05-10T23_28_17_769Z-debug.log
First check following thing:
ping registry.npmjs.org
You will get to know the IP address from that like below:
PING registry.npmjs.org (104.16.20.35) 56(84) bytes of data.
Then
sudo vi /etc/hosts
104.16.20.35 registry.npmjs.org
Then try to do following
npm install

Initialising create-react-app with a specific version of a package

I am trying to initialise a create-react-app project.
Unfortunately this is failing when it attempts to fetch webpack-dev-server#3.1.14, as my company's internal NPM registry has decided that 3.1.14 has a vulnerability and so returns a 404.
How can I initialise create-react-app, and specify that it must use webpack-dev-server#3.1.13?
The following is the last 50 lines of the verbose output:
...
npm verb get http://myregistry:1234/jest not expired, no request
npm verb afterAdd c:\dev\npm-cache\eslint-plugin-react\7.11.1\package\package.json written
npm verb afterAdd c:\dev\npm-cache\jest\23.6.0\package\package.json not in flight; writing
npm verb correctMkdir c:\dev\npm-cache correctMkdir not in flight; initializing
npm verb cache add spec eslint#5.6.0
npm verb addNamed "5.6.0" is a plain semver version for eslint
npm verb addNameVersion registry:http://myregistry:1234/eslint not in flight; fetching
npm verb get http://myregistry:1234/eslint-plugin-flowtype not expired, no request
npm verb afterAdd c:\dev\npm-cache\jest\23.6.0\package\package.json written
npm verb afterAdd c:\dev\npm-cache\eslint-plugin-flowtype\2.50.1\package\package.json not in flight; writing
npm verb correctMkdir c:\dev\npm-cache correctMkdir not in flight; initializing
npm verb get http://myregistry:1234/webpack-dev-server not expired, no request
npm verb addRemoteTarball http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz not in flight; adding
npm verb addRemoteTarball [ 'http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz',
npm verb addRemoteTarball '60fb229b997fc5a0a1fc6237421030180959d469' ]
npm verb afterAdd c:\dev\npm-cache\eslint-plugin-flowtype\2.50.1\package\package.json written
npm verb get http://myregistry:1234/babel-core not expired, no request
npm verb get http://myregistry:1234/eslint not expired, no request
npm info retry fetch attempt 1 at 9:58:55 AM
npm info attempt registry request try #1 at 9:58:55 AM
npm http fetch GET http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz
npm verb afterAdd c:\dev\npm-cache\babel-core\7.0.0-bridge.0\package\package.json not in flight; writing
npm verb correctMkdir c:\dev\npm-cache correctMkdir not in flight; initializing
npm verb afterAdd c:\dev\npm-cache\eslint\5.6.0\package\package.json not in flight; writing
npm verb correctMkdir c:\dev\npm-cache correctMkdir not in flight; initializing
npm verb request uri http://myregistry:1234/webpack
npm verb request no auth needed
npm info attempt registry request try #1 at 9:58:55 AM
npm verb etag "3cb43ef0e59f247dfcf5f855611d5749"
npm http request GET http://myregistry:1234/webpack
npm verb afterAdd c:\dev\npm-cache\babel-core\7.0.0-bridge.0\package\package.json written
npm http fetch 404 http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz
npm ERR! fetch failed http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404
npm verb afterAdd c:\dev\npm-cache\eslint\5.6.0\package\package.json written
npm http 304 http://myregistry:1234/webpack
npm verb headers { 'x-powered-by': 'Sinopia/1.4.0',
npm verb headers etag: '"3cb43ef0e59f247dfcf5f855611d5749"',
npm verb headers 'x-status-cat': 'http://flic.kr/p/aXY3dH',
npm verb headers date: 'Tue, 22 Jan 2019 09:58:55 GMT',
npm verb headers connection: 'keep-alive' }
npm verb etag http://myregistry:1234/webpack from cache
npm verb get saving webpack to c:\dev\npm-cache\appduv03d1.machine.test.group_4873\webpack\.cache.json
npm verb correctMkdir c:\dev\npm-cache correctMkdir not in flight; initializing
npm verb cache add spec webpack#4.19.1
npm verb addNamed "4.19.1" is a plain semver version for webpack
npm verb addNameVersion registry:http://myregistry:1234/webpack not in flight; fetching
npm verb get http://myregistry:1234/webpack not expired, no request
npm verb afterAdd c:\dev\npm-cache\webpack\4.19.1\package\package.json not in flight; writing
npm verb correctMkdir c:\dev\npm-cache correctMkdir not in flight; initializing
npm verb afterAdd c:\dev\npm-cache\webpack\4.19.1\package\package.json written
npm info retry fetch attempt 2 at 9:59:05 AM
npm info attempt registry request try #1 at 9:59:05 AM
npm http fetch GET http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz
npm http fetch 404 http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz
npm ERR! fetch failed http://myregistry:1234/webpack-dev-server/-/webpack-dev-server-3.1.14.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404
what is the error showing
simple way:if i am getting you
1.create-react-app my-app
2.cd my-app
3.npm i webpack-dev-server#3.1.13
4.if high severity vulnerability comes in just run npm audit fix to fix them, or npm audit for details
if any dependencies are migrated or has problem within you will find the solution in terminal msg,
i think it will work
$ npm set registry https://registry.npmjs.org
than clean cache
$ npm cache clean
$ npm rebuild
or it could be proxy server issue
try other internet connection

react-native init AwesomeProject throws ETIMEDOUT error when its about to build react-native

I've been trying to init a new react-native project and always run into the same ETIMEDOUT error.
I've run "react-native init AwesomeProject --verbose" on Terminal
Here is my npm-debug.log: https://gist.github.com/danielweinmann/a3a05ec4c253b9ff0016
I've tried setting npm registry to registry.npmjs.org with both http and https on the URL.
I started testing on a Mountain Lion and then upgraded to El Capitan and continued to get the same result
It seems to install all dependencies correctly and successfuly make all afterAdd writes to package.json, but throws the error after an "unlock" verb that's executed after an "about to build".
Here's the last part of my terminal screen:
npm verb afterAdd /Users/danielweinmann/.npm/uglify-js/2.4.24/package/package.json written
npm verb about to build /Users/danielweinmann/projects/AwesomeProject/node_modules/react-native
npm verb unlock done using /Users/danielweinmann/.npm/_locks/react-native-b39cdeb3f4f93e0a.lock for /Users/danielweinmann/projects/AwesomeProject/node_modules/react-native
npm verb stack Error: connect ETIMEDOUT 23.235.46.162:443
npm verb stack at Object.exports._errnoException (util.js:856:11)
npm verb stack at exports._exceptionWithHostPort (util.js:879:20)
npm verb stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1062:14)
npm verb cwd /Users/danielweinmann/projects/AwesomeProject
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/Cellar/node/5.4.1/bin/node" "/usr/local/bin/npm" "install" "--verbose" "--save" "react-native"
npm ERR! node v5.4.1
npm ERR! npm v2.14.15
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT 23.235.46.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm verb exit [ 1, true ]
npm verb unbuild node_modules/react-native
npm info preuninstall react-native#0.18.0-rc
npm info uninstall react-native#0.18.0-rc
npm verb unbuild rmStuff react-native#0.18.0-rc from /Users/danielweinmann/projects/AwesomeProject/node_modules
npm verb gentlyRm vacuuming from /Users/danielweinmann/projects/AwesomeProject/node_modules/.bin/react-native up to /Users/danielweinmann/projects/AwesomeProject
npm info postuninstall react-native#0.18.0-rc
npm verb gentlyRm don't care about contents; nuking /Users/danielweinmann/projects/AwesomeProject/node_modules/react-native
npm ERR! Please include the following file with any support request:
npm ERR! /Users/danielweinmann/projects/AwesomeProject/npm-debug.log
`npm install --save react-native` failed
Does anyone know what's happening? Can anyone help me?
Thanks a lot!
In the end, it was a network issue, indeed. I solved it by routing my mobile phone's internet connection to my computer through wi-fi.
In my case I have to disable firewall on my belkin router. Related to https://github.com/npm/npm/issues/8293 not react-native specific