Something went wrong installing JavaScript dependencies, check your npm logfile or run npm install again manually [duplicate] - firebase

I am using react native and Expo. I am unable to build new app because after I use expo init appName it shows the following error.
Heres the full message:
📦 Using npm to install packages. You can pass --yarn to use Yarn instead.
√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
I tried multiple times to create a blank project, also tried npm install to install failed/not downloaded libraries and continue after failure but it showed another error:
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
also tried npm cache verify that showed cache is ok Content verified: 3562 (252580364 bytes).
So, How can I solve this issue?

Problems related to npm installation are very common If you do any mistake in early installation, but is avoided. Learn more about npm tree.
Steps worked for me are :
npm cache clean --force
npm cache verify
npm -g uninstall expo-cli --save
npm install expo-cli --global
expo init app-name
cd app-name
npm start
Always run as administrator if working on Windows and in root directory.

The solutions above didn't work for me but if you use 'npm install' in the directory of the app you get a clue that you shuold try 'npm install --force'
err message
You should have all these files folders and files at the start of the project otherwise not all the dependencies have been installed which is why we were getting the problem.folder structure
After you have added --force to npm install you have all the dependencies installed. Now you can run the app with npm start.

Unfortunately, all the solutions described above didn't work on my machine...
Here is my latest solution for this problem...
This worked 100% on my machine...
Use npm i -g expo-cli
This will automatically add the required packages and also remove the unnecessary ones.
Yes, surely, you don't need to uninstall and re-install it again.
Just follow my steps.
And, you can create your expo project using expo init.
I hope my solution will help you out from this annoying problem....

I just did npm install and it worked for me, but I had do that every time I create a new expo project.

I also encountered this problem, and finally found that it was the problem of react native cli,I installed the latest version of react native cli,Expo is back to normal

This Error is regarding to the git account. expos need a git account to setup react native project
If you are using windows you need to install git in your local PC
after that open your Terminal and type this command
git config --global user.name "your_username"
git config --global user.email "your_email_address#example.com"
after that clone any github project to your local computer. it will ask to login to Github
after all these steps try expo init <projectname>

The simple way to settle that error is by using "expo-cli init app-name" instead of "expo init app-name".
I tried and worked perfectly for me. Hope it will help you guys.

i have faced a similar problem and running yarn set version 1.22.1 fix it

Run the Command Prompt as an administrator. And run the following command:
npx create-expo-app AwesomeProject

Related

Why do I get "sh: next: command not found" when running a cloned nextjs app?

I've cloned a nextjs example repo locally, and tried to run it using npm run dev, but it's not finding "next" as a command?
sh: next: command not found
I googled it, suggestions seemed to be that I should run
npm i -g create-next-app
Which I did, but still get the same error?
How can I resolve this?
For my particular case, I forgot to run npm install in the repo I'd just cloned :D
Once I did that, running npm run dev worked fine and found next.
But I suspect in general if you're trying to run a cloned repo based on npm, and get a similar response, you may simply have forgotten to install your dependencies, like I did.
Note that this can also happen for an existing project if you have some script that removes the node_modules folder as part of a cleanup process (which I do as well)

Codeship + Firebase functions:config:set = 404 method not found

Hi wonderful people of stackoverflow!
Background
I have an Angular 9 application and CI set up with Codeship. This has been running fine until about two weeks ago when suddenly it stopped working after I upgraded from Angular 7.
Set up commands:
nvm ls
nvm install v10.15.1
nvm use v10.15.1
gem install rb-inotify -v 0.9.10
gem install sass
npm install -g firebase-tools#6.12.0
npm i firebase-functions#3.3.0
yes | npm install -g #angular/cli#9.1.12
npm i
cd functions
nvm use v10.15.1
npm i
cd ..
Which runs as expected. I have checked the versions in the CI environment with npm outdated, which show me that the correct versions are being installed the same as local:
Deploy script:
firebase use default
firebase functions:config:set test="test" --token "$FIREBASE_TOKEN"
firebase deploy --token "$FIREBASE_TOKEN"
Error:
firebase use default is successful, but firebase functions:config:set test="test" --token "$FIREBASE_TOKEN" now returns:
Error: HTTP Error: 404, Method not found.
Notes:
I've reset up the $FIREBASE_TOKEN with the new cli and can confirm that this probably isn't the issue, because when the token is incorrect (I removed the last character from the TOKEN), it throws a different error stating this.
I can also confirm that the same script run locally works and deploys just fine - so while I can get around the problem this way, it isn't an ideal or long term solution.
Any ideas or help would be genuinely appreciated as I'm somewhat lost as to what to do next?
This seems to be related with firebase-tools version. When I installed the same version as you have (6.12.0) I got the same error.
I have tried on new version (I have 8.7.0) and it is working fine with one more remark. When I tried exactly the same command as you have error:
Error: Invalid argument, each config value must have a 2-part key (e.g. foo.bar).
So working command will be like this:
firebase functions:config:set test.test="test"
If you need old version of firebase-tools I tested few other versions and it seems that this is working since version 7.1.0.
For anyone else having this issue - I never managed to solved this sorry. However I migrated my CI over to use GitHub Actions easily and it all works without any issue.

Firebase CLI commands do not work with VS Code Git Bash Terminal

I have npm installed and reinstalled firebase-tools (globally), but when working in VS Code terminal through GitBash I am getting this error on any firebase command:
C:\Users\{user}\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
I do not get this error when using Command Line or PowerShell through VS Code or standalone, only with Git Bash. This error does not happen when I add .cmd to firebase.
firebase --version = error
firebase.cmd --version = 8.4.2
If anyone can shed some light as to why this is happening I'd appreciate it. I don't mind using PowerShell but I would like to know the "why" behind this error.
Versions:
VS Code 1.46.0
Firebase 8.4.2
npm 6.14.4
git 2.27.0
The operating system is Windows 10.
Try this
npm uninstall firebase-tools
npm cache clean --force
If that doesn't work then you should physically delete C:/Users/{username}/AppData/Roaming/npm and C:/Users/{username}/AppData/Roaming/npm-cache and reinstall global npm modules.
There is an open issue regarding this error, which is similar to your error.

Cannot download "https://github.com/sass/node- sass/releases/download/v4.5.2/darwin-x64-57_binding.node" error. What does this mean?

I've created used Meteor to create an APP that communicates with some hardware through MQTT using Mosquitto. It was done on a Linux computer and everyone went fine. Now I've loaded the files onto OSX and I'm getting the following error with it. I've tried updates sass to the latest verson and then redoing npm install, but to no avail.
=> A patch (Meteor 1.7.0.5) for your current release is available!
Update this project now with 'meteor update --patch'.
Errors prevented startup:
While loading package materialize:materialize#0.100.2:
error: Command failed: /Users/random/.meteor/packages/meteor- tool/.1.7.0_4.x53m8m.ifru9++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm rebuild --update-binary
Cannot download "https://github.com/sass/node- sass/releases/download/v4.5.2/darwin-x64-57_binding.node": HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
I have found a solution.
Remove the node_modules folder
Remove the package-lock.json file
Clear npm cache with
npm cache clean
Install the last version
npm install node-sass#latest
npm rebuild node-sass
Modify package.json from your project to new version of node-sass
Run
npm i
If you have another dependency that use node-sass change her version
Remove package-lock.json then npm install, again. Worked for me.
(No need to remove node modules)

Meteor 1.7 bundler is broken

I am trying to deploy an app that has been upgraded to meteor 1.7 using the setup for passenger outlined at puhsionpasserger.com, however when I try and access the app I get an error in the console of
Error: The core-js npm package could not be found in your node_modules directory. Please run the following command to install it: meteor npm install --save core-js
Being shown on the web page (although the favercon is correct so its trying).
The app runs fine locally (as in on the dev machine).
Give its deployed, meteor doesn't exist on the machine.
I tried npm install --save core.js and it reported one package installed, but still no joy on the app front.
I'm not sure where to go from here. Any thoughts?
Edit:
I just tried building the app without the --server-only flag with no change. Deployed the app the way I do with the v1.3 instances of the app and no change.
One thing that I did get when running npm intall from the /programs/server directory was
Binary is fine; exiting
npm WARN lifecycle meteor-dev-bundle#~install: cannot run in wd %s %s (wd=%s) meteor-dev-bundle# node npm-rebuild.js /opt/bundle/programs/server
added 131 packages in 13.857s
I'm not sure if the warning means anything in particular.

Resources