when I try to run mediapipe iOS demo by yarn, but I only get a "yarn_install failed: yarn install v1.22.11" response,Oddly enough, my Mac has yarn version 1.22.19, Have you ever been in a situation like this?
change the version config or I can user yarn v1.22.19 to make a successful.
The solution was to replace the yarn with the required version 1.22.11. The source could be downloaded from here
More about the yarn version control here
Related
I am working on rails 6.
couple of hours back I added sweetalert2 with yarn like
yarn add sweetalert2
and than imported it like
import Swal from 'sweetalert2'
it was working fine and than I switched github branch & when came back to original branch,
it started to give error like
Cannot find module 'sweetalert2'
not sure if missed something or what happened.
UPDATE
I did yarn install but it says already up to date & same issue still exist.
yarn install v1.21.1
warning ../package.json: No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.76s.
For sure, when you switch the branch, you can retry with npm install and yarn command as the code base has been changed/switched.
Try running yarn and npm install again.
I can add the node-libcurl to package.json/yarn.lock by typing yarn add node-libcurl. But when going to the second phase electron-rebuild, it failed all the time. I tried many node versions with nvm from 10.11.0 to 13.5.0, all failed. I would doubt it is a electron-rebuild problem, but not sure. How to make it work with electron. Can someone fatcat give me a clue?
This happens because yarn add node-libcurl is installing the prebuilt binary for the Node.js version you are using, and not for Electron.
To use node-libcurl with electron the yarn command needs some extra environment variables, this is the command you should be running:
npm_config_build_from_source=true \
npm_config_runtime=electron \
npm_config_target=$(yarn --silent electron --version) \
npm_config_disturl=https://atom.io/download/atom-shell \
yarn add node-libcurl
I am trying to set up for the react native. but whenever I update files it gives m error
enoent ENOENT: no such file or directory, open 'React Native/package.json'
npm WARN react-native#0.26.3 requires a peer of react#15.0.2 but none was installed.
npm WARN React Native No description
npm WARN React Native No repository field.
npm WARN React Native No README data
npm WARN React Native No license field.
MacBook-Pro:React Native$ npm info react dist-tags.latest
Please let me know how can I fix.
Installing react should fix the error
npm install react --save
Also, you may try upgrading your react-native install. react-native is as v0.30.0 now
npm update react-native
In my specific case I was running npm install in the wrong directory. I thought I was in my project directory but was one level higher. This meant react was missing from installed packages (because there were none) and thus gave this error.
Some steps that worked for me:
1. watchman watch-del-all
2. rm -rf node_modules
3. npm install react#15.0.2 --save
4. npm install react#15.1.0 --save
5. npm install
6. rm -fr $TMPDIR/react-*
7. npm start -- --reset-cache
In my case, the project I am working on requires a specific version of React. Since it was older than the current release, doing an install/update would still cause the error.
In order to fix the problem, I had to check the package.json of the project and install the exact version allowed by the dependency definition. In the OP's case, a
npm install react#15.0.2
should fix the problem by installing the exact version of the React module that react-native requires.
Verify that the condition was resolved by doing a npm list to see if there are any other unmet peer dependencies.
I see from here https://github.com/jquery/jquery-ui that jquery-ui's latest release is 1.11.4. However, when I use "npm install jquery-ui", it's only 1.10.3. I checked this version in node_modules/jquery-ui/jquery-ui.js.
Is there any way for me to install the latest version?
jQuery-ui specifically needs to be build after installation. To avoid this, use npm install jquery-ui-dist
T J gave the right answer, but it is a bit short / too generic.
The GitHub project is at https://github.com/jquery/jquery-ui/
So the real command would be npm install github:jquery/jquery-ui (you can even skip github: as npm defaults to it).
But this would bring you the latest, unstable version (around 1.12 at time of writing), and it didn't even work when I tried.
So it is better to fetch a tagged version:
npm install github:jquery/jquery-ui#1.11.4
Generic note: AFAIK, if the project hasn't a package.json file, this kind of install can still fail.
Here is the current latest version (1.11.4), same package that bower is using, including all themes.
npm install github:components/jqueryui#1.11.4
You can install it like
npm install github:mygithubuser/myproject
as mentioned in the install documentation
After starting with a new ionic app, I can see at bower.json that comes with ionic is in devdependencies. Why is it a devdependency and not a normal dependency?
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.0.0-rc.0"
},
Thanks, I feel confused right now
having devDependencies gives you the opportunity to simplify the steps that drive you from the source files (a git clone of the project) to the production ready app
when you don't need to make changes and (develop) the application, you could just run
bower install --production
or
npm install --production
they work the same
bower install options
-F, --force-latest: Force latest version on conflict
-p, --production: Do not install project devDependencies
-S, --save: Save installed packages into the project’s bower.json dependencies
-D, --save-dev: Save installed packages into the project’s bower.json devDependencies
-E, --save-exact: Configure installed packages with an exact version rather than semver
bower documentation
npm install options
By default, npm install will install all modules listed as
dependencies. With the --production flag (or when the NODE_ENV
environment variable is set to production), npm will not install
modules listed in devDependencies.
npm documentation
This way you take less time to ship the app and don't waste bandwidth downloading stuff you won't need.
Given that, to me, the choice of listing ionic as devDependecy is a poor one: it implies that I could take advantage of this choice to get ready the app for execution this way:
git clone my-project
git cd my-project
npm install --production # ionic not installed here
ionic state restore
ionic build ios
Now, if you ignore the content of /lib folder in your sources, this should not work, and if it works because the ionic-cli does some more checks to save your ass, I think this is unclear.
From what I understand, dependencies are required to run, and devDependencies are only for development, like minification, unit tests, etc.
Both will install when you do npm install but only dependencies will install when you do npm install $package, unless you add the --dev option