Problem with npm resolution resolution from package requiring third dependency - mysql

I have a problem with a requirement, hope you can help me.
I have 1 package named #unicoderns/orm, that requires mysql
https://github.com/unicoderns/ORM
Now Im trying to code another OpenSource package named #unicoderns/cerberus, cerberus has the orm as dependency, but when I try to build cerberus I get this error:
node_modules/#unicoderns/orm/connection.d.ts:4:24 - error TS7016: Could not find a declaration file for module 'mysql'. '/home/chriss/Sites/cerberus/node_modules/mysql/index.js' implicitly has an 'any' type.
Try npm install #types/mysql if it exists or add a new declaration (.d.ts) file containing declare module 'mysql';
4 import * as mysql from "mysql";
Is obviously trying to find the types of mysql in Ceberus, but they dont exists, why?
Edit 1: typo

#unicoderns/orm lists #types/mysql in its devDependencies, so #types/mysql gets installed when you run npm install directly in #unicoderns/orm, but not when you run npm install in another package that depends on #unicoderns/orm (such as #unicoderns/cerberus). If #unicoderns/orm is going to have a declaration file such as connection.d.ts that references declarations from #types/mysql and is intended to be loaded by dependent packages, then the recommendation is to put #types/mysql in the regular dependencies of #unicoderns/orm to avoid the problem you saw.

Related

Trying to compile contract but getting "ParserError: Source "#openzeppelin/contracts/token/ERC1155/IERC1155.sol" not found: File not found."

I am trying to compile a contract so that I can start the brownie console but I keep getting the error for the contracts I am trying to import.
ParserError: Source "#openzeppelin/contracts/token/ERC1155/IERC1155.sol" not found: File not found.
--> contracts/DutchAuction.sol:3:1:
|
3 | import "#openzeppelin/contracts/token/ERC1155/IERC1155.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`
How would I go about fixing this? Much appreciated!
When importing packages, per the brownie docs you first have to install the packages. You can install them from:
Install from github
Install from ethpm
One of the most common ways is just installing directly from github releases. To do this, you have to update your brownie-config.yaml (or make this file it if you haven't already)
You then have to add the github repo as a dependency with the structure:
REPO_OWNER/REPO_NAME#RELEASE_VERSION
And then add it to remappings if you want to use the # syntax, like so:
dependencies:
- OpenZeppelin/openzeppelin-contracts#4.3.2
compiler:
solc:
remappings:
- '#openzeppelin=OpenZeppelin/openzeppelin-contracts#4.3.2'
This example should work for this specific use case if you pop it into your brownie-config.yaml
I struggled with the same issue for days. I realized my mistake: the config file was named brownie_config.yaml (with underscore) instead of brownie-config.yaml (with dash)

warn Package undefined has been ignored because it contains invalid configuration. Reason: Cannot find module 'undefined/package.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

What's the difference between depends and build-depends in debian/control file of dpkg?

Can anyone please explain what exactly is the difference between depends and build-depends?
Somewhere, I read in build-depends, we add packages required for building our package. As per my understanding, anything needed for building my executable/library should be added here. It may include tools like cmake as well as other dependencies.
And in depends, we put dependencies needed for installation. I don't understand this.
Can anyone please explain?
Thank you.
"build-depends" is used to list down the packages which are required to build / create the debian package.
"Depends" lists out the packages which are used for the functioning of the package i.e. when dpkg -i <package_name> is run, it will first install the packages listed under "Depends" and then install the final package as the final package is exporting / using the functionality of the packages defined in "Depends".

Feathersjs, feathersjs-vuex clean npm install giving issue

I am setting up a new web app with feathersjs as the back end and Vue + feathers client (feathers-vuex) as my front end. However, after installing the packages using npm, I am getting multiple import errors as follows -
Could not find a declaration file for module 'module-name'. '/path/to/module-name.js' implicitly has an 'any' type
This is happening for the following modules (including npm install command):
Frontend:
#feathersjs/feathers
#feathersjs/socketio-client
socket.io-client
#feathersjs/authentication-client
feathers-vuex --save
Backend:
feathers-sequelize
feathersjs-authentication
feathersjs-authentication-local
I looked at this stackoverflow question
Could not find a declaration file for module 'module-name'. '/path/to/module-name.js' implicitly has an 'any' type
I tried to install types from #types which worked for some of the modules except for: feathers-sequelize (Backend) and feathers-vuex (Frontend)
It seems *.d.ts file is not created for either and that is what is missing from my current setup.
Is there something basic that I am missing? I am new to the world of node.js and feathersjs so apologies for any noob mistakes!

MonoDevelop ValaBinding install failed

I installed monodevelop in ubuntu 13.04 from git with the help of README.md, but I received an error
checking for LIBVALA... no
configure: error: Package requirements (libvala-0.12 >= 0.12) were not met:
No package 'libvala-0.12' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBVALA_CFLAGS
and LIBVALA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I have installed libvala-0.20-0 and libvala-0.20-dev by apt-get.
I have googled for this question and found some links,but helpless.
my mono was at version 3.6.1.
THX FOR HELP.
update 2014-06-19
I found the config.log file and see the error
configure:4075: checking for LIBVALA
configure:4084: $PKG_CONFIG --exists --print-errors "libvala-0.12 >= $LIBVALA_REQUIRED_VERSION"
Package libvala-0.12 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvala-0.12.pc'
to the PKG_CONFIG_PATH environment variable
Although I have installed libvala-0.20-0 and libvala-0.20-dev, I doesn't own a libvala-0.**.pc file.
What can I do the next?
I have resolved thest problem by finding a libvala-0.12.pc file :)
While the Vala language, valac, and most of the bindings distributed with Vala are meant to be API stable, libvala is not. libvala-0.20 provides a very different API/ABI from libvala-0.12, and apparently MonoDevelop's Vala plugin hasn't been updated since Vala 0.12.
If you don't want the Vala plugin, I'm sure MonoDevelop provides a way to disable it (probably passing --disable-vala or something similar to ./configure). If you need the Vala plugin, though, you'll have to install libvala-0.12 or update the plugin to use a newer version of libvala.
now the problem is solved.
I used cn.archive.ubuntu.com/ubuntu for my apt-get.
These's no libvala-**.pc file in the package.
So whatever version I installed by apt-get, I can not get a libvala-*.pc file.
I searched in google for libvala-12.0.pc and changed my source to cz.archive.ubuntu.com/ubuntu, then I got that file.
Now I can run my monodevelop with valabinding.
Thx for #nemequ , I didn't use a higher libvala, so I don't know if it will be different when using a libvala-hight-than-12.0.pc file.
Hope these is usefull for others.
If you don't want to install vavabind after configure once ,just use ./configure --select, it's written in README. My bad :(