warn Package undefined has been ignored because it contains invalid configuration. Reason: Cannot find module 'undefined/package.json' - json

In my app.json folder, I have everything bundled nicely, but I have one undefined package at the bottom of the install list:
"undefined": "react-navigation/bottom-tabs"
I tried running an "npm install react-navigation/bottom-tabs" but it threw this error:
warn Package undefined has been ignored because it contains invalid configuration. Reason: Cannot find module 'undefined/package.json'
Has anyone encountered an issue like this before? I am running React-Native Version 5 on top of Expo.
EDIT: It turns out that it was supposed to be #react-navigation/bottom-tabs, so I installed that and made an adjustment; but now I am still stuck with the original undefined package in my app.json folder, and cannot get rid of it.

So, I forgot this post existed and I actually figured this out months ago. When you're dealing with:
A bad bundle,
the wrong version,
or there's just something wrong with your 'package.json' file, (the file that contains the list of your packages)
These steps should fix it:
Perform "npm uninstall 'package-name' " or "yarn remove 'package-name'"
Note: You do this instead of 'expo-uninstall' because 'expo-uninstall' does not exist. We use 'expo-install' instead of 'npm' or 'yarn' install to make sure you download the proper npm or yarn version associated with your version of expo.
Open the package.json file and see if the bad package you uninstalled is still present.
If the bad package is still there, select and delete it from the file, then save.
Run an "expo" "npm" or "yarn" install on the correct package name
This should fix it. This is best fixed when step 4 is executed with an 'expo install' as you likely have an incompatible version of the package, so this will prevent that from happening again.
In my case, I couldn't figure out why my terminal was telling me a specific package didn't exist, so I did a "sud" command to force download the package. This package didn't exist, because I had actually spelled it wrong.

try deleting your node modules and install them again and make sure your metro is closed
clear cache and you are good to go by the way it worked for me
npm install or yarn add
npm start --reset-cache

Related

lzma_stream_encoder_mt_memusage missing from dpkg-deb

Recently, after an interrupted dist-upgrade, I've been experiencing some issues with dpkg-deb.
Most frequently, I get one specific issue:
dpkg-deb: relocation error: dpkg-deb: symbol lzma_stream_encoder_mt_memusage, version XZ_5.2 not defined in file liblzma.so.5 with link time reference
The message is very clear, but it's not clear to me how this should be fixed.
I've tried reinstalling liblzma5 from the default 17.10 PPAs, with no dice.
I've also tried to apt install --reinstall dpkg, also to no effect.
I've tried installing liblzma5 from source and updating my $LDPATH to reflect the new build's path, but I'm not sure which flags to use to export the missing symbol; a plain ./configure && make && make install doesn't seem to.
How can I fix this issue?
I was able to fix this by copying the file /lib/x86_64-linux-gnu/liblzma.so.5.2.2
from a machine already upgraded to bionic.

React Native packager not locating package.json

I installed Atom and Nuclide and opened a newly initialized React Native Project in Atom. Once I try to start the React Native Packager I am getting an error stating
An unexpected error occurred while running the React Native Packager process:
ENOTDIR: not a directory, stat '/Users/UserName/Documents/MyProjectDirectory/ProjectName/package.json/package.json'
There is no directory called package.json and I'm not aware how this path could have become corrupted. Any help would be much appreciated.
Not a solution, but a workaround for now:
You can run the following to start the packager manually: npm start
Or, generally, running react-native run-ios (or run-android) will start the packager as a matter of course (in a separate terminal window).
(Also no clue why this is happening; for me, it was after the upgrade from RN 0.49 ~> 0.50.)

Npm - Unexpected token } in JSON at position 0

Yesterday I installed the JSDoc package using npm install -g jsdoc and used it just fine. Today when I tried to use it again, I got the following error:
module.js:96
throw e;
^
SyntaxError: Error parsing ...npm\node_modules\jsdoc\node_modules\requizzle\package.json: Unexpected token } in JSON at position 0
at Object.parse (native)
at readPackage (module.js:92:52)
at tryPackage (module.js:102:13)
at Function.Module._findPath (module.js:172:20)
at Function.Module._resolveFilename (module.js:438:25)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
I've actually gotten this numerous times before and a clean reinstall of the package fixes it, but I was wondering what keeps causing this error and if a more permanent fix were available.
When I open up the package.json file mentioned in the error, it looks like a binary file with a bunch of weird symbols.
I see that the first character is a } which kinda explains the error. Thing is all the package.json files for every package I download looks like that, and it works the first time so npm apparently can parse this.
EDIT:
Quick note: I am on my office laptop.
Ok so I cleaned out the node_modules folder and reinstalled jsdoc with npm install -g jsdoc. I checked the package.json file: it's all plaintext and looks great.
I then shut down and start up my computer. Not only is the jsdoc package.json file obfuscated, the package.json files of all its dependencies are also obfuscated! This little bug is recursive!
To test it further, I took the json file, duplicated it and renamed it PACKAGE_DUP.json and placed it right next to the original json file. I also took the node_modules folder and made a copy called NODE_MOD_DUP, again next to the original. So now there are 4 package.json files:
node_modules/package.json
node_modules/PACKAGE_DUP.json
NODE_MOD_DUP/package.json
NODE_MOD_DUP/PACKAGE_DUP.json
When I restarted my computer, the only json file affected was the package.json file in the node_modules folder (item number 1). So it's being targeted by something!
Virus scans are coming up clean, and every other json file in the modules folders and on my system as a whole are completely unscathed. Also, the package.json files that come with the modules bundled with node work fine. It's only modules installed with npm install that are giving me a problem (whether installed globally or locally for that matter).

Aurelia bundle with gulp throws "TypeError: Path must be a string. Received undefined"

I'm using the skeleton-typescript aurelia skeleton-navigation package, when running gulp bundle it gives me an error that says path must be a string but was undefined
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.basename (path.js:801:5)
at exports.writeOutputs (C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\lib\output.js:137:23)
at C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\lib\builder.js:575:14
at tryCatcher (C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\joaoe\Desktop\skeleton-navigation\skeleton-typescript\node_modules\systemjs-builder\node_modules\bluebird\js\release\promise.js:502:31)
All gulp related files can be found here since there are more than one.
Even the cloned package throw that.
I'm running Node 6.0.0 and tested with 5.9.1, on Windows 10.
There is some property that I need set to be that path ? Seems related to Aurelia pre built tasks, from comments could also be an environment problem.
As I tracked it down, the issues seems to be an ugly combination of node-gyp, Windows and node 6
So install all dependencies needed for node-gyp, following your OS steps as seen at official repo. Unfortunately for now if you are running Windows is likely that you need to install Visual Studio. Then run npm install on the repository and see if there is any error, should be no one now. Then try to gulp bundle it should work now. With downgraded node to 5.11 I was able to run again, I did not test with node 6 but feel free to try.

react-native init gives Error: Couldn't find preset "es2015"

When I'm trying to start a new react-native project from scratch I'm getting this message.
/Users/jorgevenegas/Dev/Projects/testreact/List/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:327
throw new Error("Couldn't find preset " + JSON.stringify(val) + " relative to directory " + JSON.stringify(dirname));
^
Error: Couldn't find preset "es2015" relative to directory "/Users/jorgevenegas/Dev/Projects"
I have installed react-native-cli, of course. Using node v4.2.1, react-native 0.1.5, watchman and flow installed too.
Seems to be something related to babel. I can't figure out the reason, though.
I'm attaching a screenshot with a more detailed output.
Thanks in the advance!
This bugged me for a good 1 day. The issue was I had a .babelrc file up in my file hierarchy which was interfering with babel parsing. Got rid of that and it was fine. react-native uses es2015 by default so .babelrc is not required.
Try installing the following packages
npm install babel-preset-es2015 --save
npm install babel-preset-react --save
I had the same problem.
The solution for me was to switch from 'workspace/MyProject' (for you its "/Users/jorgevenegas/Dev/Projects" i guess) to 'workspace'.
I don't know why I had to do this, but when i ran
npm install babel-preset-es2015
npm install babel-preset-react
in my workspace instead, i could cd into 'MyProject' again and execute a react-native run-android from there.
Hope that helps at least some people encountering the same problem.
Add the following line to your .babelrc file:
{"presets": ["react"]}
I find solution from babel.io
I went through something similar, maybe this can help. In my case it was because for some reason I had two instances of react-native installed on my system.
Check the output of
which -a react-native
If you get more than one path with react native installed, get rid of the one that gives you the same error when executing init directly with the full path (my case was one installed at /usr/local/bin/react-native, but yours could be slightly different).
After removing the wrong one, you should be able to init projects without any problems.