Expo "Cannot find module 'color-convert'" Problem :( - javascript

I have problem! I just write terminal npm start and it shows:
Starting project at /home/pc/Documents/Projects/Mobile/weather_app
Developer tools running on http://localhost:19002
Cannot find module 'color-convert'
Require stack:
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/ansi-styles/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/chalk/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/#babel/code-frame/node_modules/#babel/highlight/lib/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/#babel/code-frame/lib/index.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/node-haste/DependencyGraph.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/Bundler.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/IncrementalBundler.js
- /home/pc/Documents/Projects/Mobile/weather_app/node_modules/metro/src/index.js
- /usr/lib/node_modules/expo-cli/node_modules/#expo/dev-server/build/metro/importMetroFromProject.js
- /usr/lib/node_modules/expo-cli/node_modules/#expo/dev-server/build/HermesBundler.js
- /usr/lib/node_modules/expo-cli/node_modules/#expo/dev-server/build/MetroDevServer.js
- /usr/lib/node_modules/expo-cli/node_modules/xdl/build/start/startDevServerAsync.js
- /usr/lib/node_modules/expo-cli/node_modules/xdl/build/internal.js
- /usr/lib/node_modules/expo-cli/node_modules/xdl/build/index.js
- /usr/lib/node_modules/expo-cli/build/exp.js
- /usr/lib/node_modules/expo-cli/bin/expo.js
Please, help me fixing the problem!
npm version: 8.3.1
node version: v17.3.0
expo version: 5.2.0

I am not quite sure what might have caused your problem but you can try the following fixes and see if any of them works for you:
$ npm i color-convert to make sure you have installed the module color-convert.
$ expo r -c to clear cache and restart your app, it could be that your app has not updated that cache after installing the module color-convert.
You may also delete node-modules directory and run again npm i or yarn to download and all the modules and their correct dependencies.

Related

eas build -p ios problem with pod install

try to build an IPA with EXPO EAS now but i keep facing this problem with the pod install
i expect building an IPA as i use to do before with : expo build
plus the expo build was working just fine
here the error i get
Using Expo modules2Auto-linking React Native modules for target Malabiss: RNCAsyncStorage, RNCPicker, RNGestureHandler, RNReanimated, RNSVG, RNScreens, RNVectorIcons, and react-native-safe-area-context3[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json4Analyzing dependencies5Fetching podspec for DoubleConversion from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec6[Codegen] Found FBReactNativeSpec7Fetching podspec for RCT-Folly from ../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec8Fetching podspec for boost from ../node_modules/react-native/third-party-podspecs/boost.podspec9Fetching podspec for glog from ../node_modules/react-native/third-party-podspecs/glog.podspec10Adding spec repo trunk with CDN https://cdn.cocoapods.org/11[!] Unable to find a specification for UMCore depended upon by UMPermissionsInterface12You have either:13 * out-of-date source repos which you can update with pod repo update or with pod install --repo-update.14 * mistyped the name or version.15 * not added the source repo that hosts the Podspec to your Podfile.16pod exited with non-zero code: 1

"gatsby develop" cannot run in Mac M1

Iam using gatsby 3.1.2 version with strapi as CMS, were i could not able to run gatsby develop and it is throwing this below mentioned error. Also attached the screenshot from terminal.
ERROR
Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.
- options should be one of these:
object { resourceRegExp, contextRegExp? } | object { checkResource }
Details:
* options misses the property 'resourceRegExp'. Should be:
RegExp
-> A RegExp to test the request against.
* options misses the property 'checkResource'. Should be:
function
-> A filter function for resource and context.
System Informations:
Gatsby CLI version: 4.0.0
Gatsby version: 3.14.6
Node version: v14.18.0
NPM version: 6.14.15
In case it helps anyone, prior to this error (where it just doesn't run, without throwing any errors or clues) I had a hard time with npm install, but I was able to fix that by running the following:
brew reinstall vips
xcode-select --install
brew install gcc
brew reinstall vips
brew info vips
npm i

How to uninstall latest node & downgrade to old version [duplicate]

This question already has answers here:
Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule'
(6 answers)
Closed last year.
Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule' Require stack: - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\validate\preNormalization\tagDirective.js
C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\validate\preNormalization\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\validate\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\composeAndValidate.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\composition\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#apo
llo\federation\dist\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\providers\schema\file.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\providers\schema\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\project\base.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules\apol
lo-language-server\lib\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\lib\commands\clie
nt\codegen.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\config\lib\plugin.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\config\lib\config.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\config\lib\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\command\lib\command.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\node_modules#ocl
if\command\lib\index.js - C:\Users\Minseo\AppData\Roaming\npm\node_modules\apollo\bin\run Code: MODULE_NOT_FOUND
I face this issue while downloading schema in latest version of node, so i want to downgrade it to previous version.
Thanks
Open Terminal & run these command on macbook
cd /usr/local/include
sudo rm -R node
cd ../lib
sudo rm -R node_modules
cd ../bin
sudo rm -R node
**After that check node version if it's uninstall compeletely enter **
node -v
Result
"-bash: node: command not found"
You can use NVM(Node Version Manager).
**First Step **
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
Second Step
Install Specific Version Using NVM
nvm install <version>
if you are getting any error of nvm use below code
source ~/.nvm/nvm.sh
then again follow the second step
Third step
use this below command
nvm use <version>
then check the version
node -v

expo init <project name> throwing npm ERROR (windows OS)

Just started with expo and React-Native and when I run
expo init ProjectName
I am getting an error stating:
Unexpected end of JSON input while parsing near '...,"version":"7.0.0-bet'
Process exited with non-zero code: 1
Set EXPO_DEBUG=true in your env to view the stack trace.
When I add the said thing in env (using set EXPO_DEBUG=true on windows), I get the following error:
Error: Process exited with non-zero code: 1
at ChildProcess.child.on (C:\Users\mohit\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\build\spawnAsync.js:39:21)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.cp.emit (C:\Users\mohit\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
It's something related to 'spawn-async'. I was also getting issues with 'spawn' sometime earlier while creating a node-server...but I resolved that there and then using 'exec' instead. Tried to find this on expo forums and even in react-native issues but couldn't find a solution. Can someone plz suggest something? Is it some "windows" thing only or something related to npm releases?
P.S: I also ran create-react-native-app ProjectName and again got a similar kind of error about end of JSON input!
Now I know what can be the issue, it can be just the trivial one:
Please update node an npm to the newest available version and please init you project again in different directory.
You'll need to have Node.js (version 10 or newer) installed on
your computer. Download the latest version of Node.js.
Additionally, you'll need Git to create new projects with Expo
CLI. You can download Git from here.
Make sure that you have installed these two things in your device.
Go to doc for expo installation
in my case. make sure you have yarn installed and update tour android studio packages, for it to work

Run selenium jar on travis CI from protractor node_modules folder

I am setting up Travis in order to execute e2e tests through protractor.
On my protractor.config.js I have the following:
seleniumServerJar: './node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar'
So actually it refers to the selenium jar included by default inside the protractor plugin.
Then I use the plugin gulp-protractor in order to execute the tests pointing to the right protractor.config.js.
Locally everything works like a charm.
But when trying to execute this on Travis, I am getting the following error:
[18:59:15] I/launcher - Running 1 instances of WebDriver [18:59:15]
E/local - Error code: 135 [18:59:15] E/local - Error message: No
selenium server jar found at
/home/travis/build/quirimmo/Qprotractor/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar.
Run 'webdriver-manager update' to download binaries.
Any idea why it looks like it cannot retrieve the jar from the node_modules subfolder please?
Here my .travis.yml configuration, which is actually pretty simple:
sudo: required
dist: trusty
addons:
chrome: stable
language: node_js
node_js:
- '6.11'
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
install:
- npm install
script:
- echo "Triggered!"
- gulp protractor-test
Thanks a lot, any help would be really appreciated!
p.s. I already did it on other projects with Travis running manually the webdriver-manager and then pointing to the selenium address from the protractor.config.js, but I don't want that solution and I want to go on through the seleniumServerJar property, because in this way it will run everything alone without any need of starting manually the webdriver-manager
Fixed in your repo. You should change your before_script to below
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- npm install -g webdriver-manager
- webdriver-manager update
- webdriver-manager start &
- sleep 3
And then in your protactor.confg.js add the seleniumAddress
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub/',
specs: [
'./test/base-protractor.spec.js',
'./test/element-finder.spec.js',
'./test/element-array-finder.spec.js'
],
onPrepare: function() {
require('./index');
}
};
Posting here the answer if this could be useful for someone else in the future.
As explained very well in this link:
https://github.com/angular/protractor/issues/3225
You need to manually trigger the installation of the selenium server.
So in the install block of your travis file, you can simply add this:
install:
- npm install
- node_modules/protractor/bin/webdriver-manager update
And then inside the protractor.config.js, grab the current version of the installed selenium server:
const SELENIUM_FOLDER = './node_modules/protractor/node_modules/webdriver-manager/selenium';
const fs = require('fs');
let res, seleniumVersion;
fs.readdirSync(SELENIUM_FOLDER).forEach(file => {
res = file.match(/selenium-server-standalone-(\d{1}.\d{1}.\d{1}).jar/i);
if (res) {
seleniumVersion = res[1];
}
})
if (!seleniumVersion) {
throw new Error('No selenium server jar found inside your protractor node_modules subfolder');
}
And then execute it in this way:
seleniumServerJar: `./node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-${seleniumVersion}.jar`
I hope this will help someone else avoiding to lose few hours of time against this issue!

Categories