invalid-meta The "main" field has to contain only 1 file per filetype; found multiple .js files - bower

invalid-meta The "main" field has to contain only 1 file per filetype; found multiple .js files: ["dist/js/jquery.keyboard.js","layouts/keyboard-layouts-combined.js","layouts/keyboard-layouts-greywyvern.js","layouts/keyboard-layouts-microsoft.js"]
bower install is failing due to this error. How do I fix it?
"keyboard": "^1.26.25"

Downgrade your bower to an earlier version that doesn't get those errors. I've resolved this by using a 1.4.x version. Try npm i -g bower#~1.4.0.

Related

Autoprefixer error in sublime 4, mapping and package.json

hi i installed autoprefixer css via package install . node.js is installed and i think i did everything right but when i try running it this error is showing up:
Autoprefixer
Error: (node:20773) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/"myusername"/Library/Application Support/Sublime Text/Packages/Autoprefixer/node_modules/postcss/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use node --trace-deprecation ... to show where the warning was created)
can someone help me with it ?
thx
This is an issue with one of Autoprefixer's JavaScript dependencies, named postcss. The Autoprefixer plugin hasn't been updated in over a year, so some of its dependencies have grown a little stale. However, as detailed here, the fix is pretty straightforward.
Open the Terminal app, and type in
cd "~/Library/Application Support/Sublime Text/Packages/Autoprefixer"
(don't forget the quotes around the path, as it contains spaces)
Once in that directory, just run
npm update
and the JS deps should be updated. Restart Sublime, and you should be all set.
I found the same error:
[DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in
the "exports" field module resolution of the package at
.../node_modules/tslib/package.json.
Then I solved it by exploring in the file /node_modules/tslib/package.json and update the package.json file with the following.
"exports": {
...,
"./": "./*"
}

. Why I am getting an error message? Building a React App

I wanted to start practicing with React to make a simple app. Went ahead and downloaded homebrew and node onto my computer. As I build my app with yarn install I get to the end where it tells you happy hacking. But when I run yarn start it gives me an error message.
-There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"eslint": "^6.6.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:
/Users/zacharyschneider/node_modules/eslint (version: 5.16.0)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if /Users/zacharyschneider/node_modules/eslint is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls eslint in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed eslint.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
zacharyschneider#Zacharys-MBP %
A way to solve this issue or help me understand what is going on that would be great or point me in the right direction to find resources.
Thanks for your Help
It seems like you have installed es-lint 5.16.0 manually, and it conflicts with the needed version (6.6.0).
Have you tried the steps suggested in the error message?
Do you explicitly tell the es-lint version in your package.json? Could you share your package.json if you continue to experience the issue?

Lerna issue - Convector project "'<controller>.controller.ts' is not under 'rootDir' 'rootDir' is expected to contain all source files"

When a Lerna command fails (calling lerna add <package> lerna bootstrap), the project may break and experience some of the following issues:
Project folders erased
Compile (tsc) errors like File '/<home>/<project>/packages/<chaincode>-cc/src/<controller-name>.controller.ts' is not under 'rootDir' '/<home>/<project>/packages/<chaincode>-cc/src/'. 'rootDir' is expected to contain all source files.
It's a Lerna issue but may affect Convector CLI generated projects, since it's a dependency.
It usually happens when a package is imported incorrectly (it may happen due to automatically importing packages with VS Code, which usually set the packages wrong)
For example:
import { <controller>Controller } from '../../../<controller>-cc/src';
This will throw errors when trying to resolve packages.
The way to solve it is by fixing the import path like:
import { <controller>Controller } from '<controller>-cc';
Then clean things and refresh packages.
lerna clean
# Remove the root node_modules folder
npm i

Bower - Get only files needed (not entire Repo)

I am trying to use Bower to install jquery.
The frustrating problem I have been running into is that bower downloads the entire repro. I was hoping to tell bower to install a certain version of jquery and have only those files downloaded.
I did try the suggestion here with no luck. The entire repo is still downloaded even after clearing the bower cache
I would rather have something else manage which files to download than me manually specifying the file names in bower.json
bower.json in the repo : https://github.com/jquery/jquery/blob/master/bower.json
Thank you
I think you didn't unterstand the meening of bower:
Bower is handling you dependencys, so if you do a:
bower install jquery
it should download all files.
Now to you question:
you have following options:
declare wich file you want to download:
bower install http://code.jquery.com/jquery-2.1.0.min.js
but remember:
this file cant be updated easily
search for a js only package:
expample with bootstrap:
bower install bootstrap-css-only
but remember:
these packages sometimes are not up to date
use bower-installer (recommended):
install the bower-installer:
npm install bower-installer --global
and now follow the tutorial:
bower-installer github
sorry for my bad english :-)

Why does bower install github/repo not clone my bower.json?

When I install a library from a git repo via:
bower install git#github.com:fabiantheblind/p5.js.git --save
the component gets cloned into my bower_components but there is no bower.json in the folder. Just a .bower.json.
Why is that so and how can I fix this?
I also get the output:
bower invalid-meta p5.js is missing "main" entry in bower.json
bower invalid-meta p5.js is missing "ignore" entry in bower.json
But the entries are there.
(The final aim is to use grunt-wiredep to install dependencies automagically. See my open issue here )
Okay. After fiddeling a bit more I got the answer:
My clone of the repo had the bower.json but I did not create a tag for it. So bower was still looking at the latest tag 0.3.6 where no bower.json was present.
By creating the tag 0.3.7 the problem is solved.

Resources