Problems installing the expo-cli - node.js

I've been trying for the past few hours to install the expo-cli. Half way through installation I keep getting this error:
tarball data for #expo/traveling-fastlane-darwin#1.10.0 (sha512-XXX) seems to be corrupted. Trying one more time.
After a really long time it crashes without expo-cli being installed.
I thought it could be a problem with Node.js. So I reinstalled Node.js and deleted every npm folder I could find. Furthermore cleared the cache with:
npm cache clear --force
Nothing works... Anybody has an idea why I keep getting this error?

Looks like a common windows issue. Have you tried version 3.7.1?
npm i -g expo-cli#3.7.1
Otherwise try to install the linux subsystem and use the linux bash.

Related

The react-native init hangs on macOS Catalina, with fetchMetadata: sill resolveWithNewModule react-native#0.64.2 checking installable status

I just wanted to create a react native application using react-native init command. But it hangs with the message:
fetchMetadata: sill resolveWithNewModule react-native#0.64.2 checking
installable status
Sure I am not the first one facing the same issue and I found many answers and tried almost all solutions I found while googling it,
Examples are:
Uninstall and reinstall node
Install yarn
Clear npm cache
Install node using home-brew instead of direct installation
npm i -g react-native; then react-native init
and many other solutions, but it is still stuck.
It is not related to the MacOS version or Network connectivity etc anyway; because It worked on another machine with same OS, and on the same network.
I am sure the react native community is familiar with the question and may somebody will say this is already answered and thus will close it, but it still hangs. I don't know what the issue is.
I am not sure it is related to node or npm or some other. Because I faced the same issue, when I tried create-react-app.
I just wanted to know is there any solution to solve the issue?
and
is there anyway the node, npm or npx or other produce some error when it hangs for any reason, may be while downloading some dependency or while running some commands etc; and show some information regarding what is happened and what is missing.
Assuming this is more related to node, npm or npx; as these are responsible for downloading and running the modules and dependencies or it can be because of error handling in react-native init. Whichever, may be assuming everything fine on the machine, and may not be checking and reporting, if something is missing.
Screenshot: React Js and React-Native hangs
Few days after, surprisingly, it started working. I didn't change anything and I was planned to try a fresh installation of everything from OS installation. But now, I got it working, with no notable reason.

Bundling errors after updating an npm package in React Native app

I'm building a React Native app which, at this point, doesn't have too many dependencies.
Every time I update an outdated npm package, I am GUARANTEED to run into bundling errors. It could be any package. I then spend hours trying different ways to clear npm cache, project cache, etc.
Does anyone else have this issue? Is there a "standard" set of commands I should run after upgrading ANY npm package? This is extremely frustrating!
This screen shot shows today's flavor of the issue:
BTW, I'm on Windows 10, using VS Code. My React Native version is 0.63.1, Node version is 14.7.0 and npm version is 6.14.7
UPDATE:
After a couple of hours of messing around and removing node_modules folder several times and issuing the following commands a few times, it's now started to work. Unfortunately, I can't put my finger on what fixed it. As I said, I did the same things a few times.
Here are the steps I repeated a few times -- though once should be enough:
Deleted the node_modules folder
In root folder, I ran npm cache clean --force
I then reinstalled all npm packages by running npm i
Went into cd android folder and ran ./gradlew clean
Then in project root, I ran npm start -- --reset-cache
Unfortunately, doing this the first time didn't fix the issue. It looks like I have to waste a couple of hours for things to get back to normal! Any idea how to make this problem go away for good?
I think this error is that you have not start the metro bundle. Try react-native start and then re-run the app

Cannot find module dtrace-provider

I have a simple nodejs application that is throwing "Cannot find module './build/Release/DTraceProviderBindings'". I look it up online and it looks like that a lot of people are having the same problem when using restify on windows (which is my case, I'm using restify on windows 10). Apparently, dtrace-provider is a optional module for restify and there is no version of it for windows. So, what I tried so far:
Update node to v6.2.0;
Uninstall all modules and run npm install --no-optional;
Uninstall only restify and run npm install restify --no-optional;
And my most desperate move npm install dtrace-provider.
Everything I tried where found on github issues, I've seen same error on OSX users with other modules. Not sure what else to try.
Note: This exception does not stop my application, not even prints the error on the console, I just notice that this was happening using the debugger, in other words, my application runs fine, but this keeps happening on the background.
List of other modules I'm using:
"dependencies": {
"restify": "latest",
"request": ">=2.11.1",
"cheerio": ">=0.10.0",
"xml2js": ">=0.2.0",
"botbuilder": "^0.11.1",
"applicationinsights": "latest"
}
This worked for me after switching to Node 6.1 (and when re-installing node modules didn't work):
Install and save dtrace-provider
$ npm install dtrace-provider --save
Delete 'node_modules' folder
Re-install node modules
$ npm install
I found this thread before combining your attempts with another solution on the Github project issues for restify (https://github.com/restify/node-restify/issues/1093) and simplified best as possible.
I recently ran into this error as well on node 6.11.1.
I ran npm rebuild dtrace-provider and that resolved the problem.
The restify team followed an approach of trying to load the module by requiring it on a try/catch block. You should just ignore the exception.
I had success with the following (elaborate) sequence:
Adjust my path to not have spaces
rm -rf node_modules
rm -rf ~/Library/Caches/node-gyp/
npm cache clean --force
V=1 npm install -S dtrace-provider#0.8.8 --python=python2.7 (repeat this step, resolving as you go, until the install is completely successful … if it fails, check the version - I had rogue dtrace-provider#0.6.0 building at one point)
npm install
At this point everything should have installed cleanly, and I was congratulating myself on a job well done. Then I executed my code and still got the DTraceProviderBindings error. The cause was nested dependencies with the wrong version of dtrace-provider (especially bunyan).
To confirm, do npm list | grep dtrace -B6.
If there's anything lower than 0.8.8, edit package-lock.json, following the method in How do I override nested NPM dependency versions?. Replace requires with dependencies for dtrace-provider and update the version.
Back round to get everything clean: rm -rf node_modules
Then, again, npm install --python=python2.7
I had to iterate round npm list a few times because I thought I'd caught everything and I hadn't.
The key points were to use the required version of python, have a unix-friendly path, and hunt down all nested dependencies. The python version issues gave a big messy error, the space issue gave a much more missable error.
I know this is an old issue but I wanted to comment on it in case anyone else has the same issue I had.
My issue was caused by having parentheses in my path.
/users/karlgroves/Dropbox (Personal)/foo/bar/bat/project...
Moving the project to a path without the parens worked for me.
You'll need to wipe out node_modules and reinstall again.
I recently ran into this error as well on node v8.8.1
as #Derek mentioned, I ran npm rebuild dtrace-provider and that resolved the problem.
tl;dr; dtrace-provider utilized node-gyp which required python version >= 2.5 and NOT 3.5
I had this issue on OSX and found a post that showed using environment variable
V=/Users/your_user/your_project npm i dtrace-provider
This let me know that there was a dependency on node-gyp that was failing to build...Once I knew the issue was with this module was able to focus my attention at troubleshooting node-gyp.
This led to some log output indicating that my python version 3.5 was unsupported and it required version >= 2.5.
Went and downloaded python 2.7.x and checked /usr/bin/python 2.7.x to ensure it was there. Uninstalled the node module that was ultimately requiring this module, then used npm cache clean then reinstalled the module and this time it appeared to pick up the right python version to be able to build.
Hope this helps someone =)
I have tried many suggestions but get the same error again.
Finally, I found the correct way to solve this question.
Go the node.js website and download the latest version of node.js pkg.
After installed, reinstall your software, everything will be ok.
i managed to get this working by running this command
npm install --python=python2.7

npm hangs on postinstall / unlock

I have a Linux server that runs some virtual Machines using KVM. Host machine is a Debian derivate with kernel 2.6.32-32(-pve).
In roughly 75% of the times I run npm install, it hangs while installing modules. I ran it in silly debug level and it always hangs at the line
npm info postinstall [module name] (older npm versions)
or
npm verb unlock done using [...] (newer npm versions)
forever.
It happens in every project on the host machine and on the virtualized systems for every node and every npm version I have tested (a lot, including the newest ones (2.7.x atm)).
It also is not deterministic. Sometimes it works, sometimes not and most of the times it hangs on a different module.
On my dev machine (which is in the same network, running OS X 10.10) it works fine.
I am not behind any kind of proxy.
What could possibly be wrong here?
EDIT: For the time being I solved this problem by checking in all my dependencies as gzipped files using https://github.com/JamieMason/shrinkpack
I was having the same issue for several hours, and couldn't work out what the problem was. I tried re-installing everything a few times, manually installing individual modules, switching from x64 to x86 versions of NodeJS, etc, and got nowhere.
In the end, I changed networks, from WiFi over ADSL2+ [~2mbps] to 4G Hotspot [~20mbps] and it worked in 30 seconds. No idea why, since it didn't seem like a network speed issue, but it solved the problem.
Hope this helps someone else, too!
I had the same problem on our Jenkins slaves based on Ubuntu, and it was solved by upgrading npm.
Default npm installed by apt-get has version 1.3.10 now, which is very old (shown by npm --version). There are at least two ways to upgrade it:
Run sudo npm install -g npm command. If you want to install a specific version you can run append it at the end of command: sudo npm install -g npm#2.1.3.
Or you could add NodeSource repositories using these instructions and run usual sudo apt-get update.
I have the same problem on Windows. I deleted my npm-cache folder and reinstalled npm. Everything started working normally after that.
The npm-cache folder can be found at
<your-drive>\Users\<your-name>\AppData\Roaming\npm-cache
Remember to turn on 'View hidden files because the AppData folder by default is hidden
You can reinstall npm by using the command,
npm i npm -g
On Windows make sure you are in a native CMD (not in VSCODE or whatever IDE). Also, try increasing the max memory limit for node:
set NODE_OPTIONS=--max_old_space_size=8096
I did the same, switched my network from WiFi to 3G and it worked.
I'm experiencing the same problem, this is the issue on Github:
https://github.com/npm/npm/issues/7862
There are some useful tips that seemed to help a few people.
For me doing $ npm install -g node-gyp (as suggested here: http://gangmax.me/blog/2013/05/13/resolve-npm-update-node-gyp-hung-problem/) fixed the problem.
I had the same problem and just run
npm cache clean
And it works!
Had this same problem in Windows. The solution was to restart after installing node and npm and then run command prompt as administrator.
In my case, a system restart did the work.
I ran npm install --verbose which suggested some lock on a file in npm-cache. And I think the system released the file (which was under use) after the system restart. I am using windows.
Try cloning the project again and then run npm install to install the packages in your terminal.
I ran into this with npm v6, and it turned out I was just being impatient. I just needed to wait a little longer and it proceeded to the next step.
npm cache clean --force
works for me :)
=> this method working with me When npm block in installation Package for IONIC installation and ReactNative and another package npm.
you can change temporary :
npm config set prefix C:\Users[username]\AppData\Roaming\npm\node_modules2
change the Path in Environment Variables set C:\Users[username]\AppData\Roaming\npm\node_modules2
Run the your command to install your package .
open file explorer copy the link C:\Users[username]\AppData\Roaming\npm\node_modules
ok file yourpackage.CMD created another folder Created "node_modules2" in node_modules and contain your package folder.
copy your package file CMD to parent folder "npm"
copy your package folder to parent folder "node_modules"
now run npm config set prefix C:\Users[username]\AppData\Roaming\npm
change the Path in Environment Variables set C:\Users[username]\AppData\Roaming\npm
now package working correctly with Command line

Updated NPM but still showing as old version

Getting "npm: command not found" on this computer. Only way I knew to get it was by uninstalling node with Homebrew and reinstalling from the node.js site. Just reinstalled node.js on this computer and have npm version 2.5.1 with it.
I went to update to the newest (2.7.1) using:
sudo npm install npm -g
Updated without any errors, but running npm -v tells me I'm still on version 2.5.1
In the process of looking into the issue, see that old npm related files are on this computer. Old Changelog last modified 30 days ago exists saying "v2.7.1 (2015-03-05)" so npm was updated and on here at one point.
Can anyone point me in the right direction to figure out what is going wrong?
Making some assumptions here: there isn't anything really wrong, there just might be some installation issues. Homebrew should be just fine for installing node, Thoughtbot uses it to set-up laptops (see here).
To make sure Node/NPM installation is done in a smooth way, I did this:
sudo chown -R $USER /usr/local
Per this post.
I am on Yosemite and I haven't had any issues using this set-up, especially when updating NPM (did it when I read your question).

Resources