Can I use specific version of VUEJS in Laravel project? - javascript

I am new to the VUEJS and learning it by torrent.
The author use docs from old version https://ru.vuejs.org/v2/guide/components-custom-events.html
for example .sync was added only in 2.3.0 version
<text-document v-bind:title.sync="doc.title"></text-document>
Can I use specific version(like 2.2) of VUEJS with laravel project?

Laravel uses NPM (node package manager), and any module gets into node_modules directory.
Install Node.js.
Open terminal and cd into your project root.
Then just run:
npm install --save vue v2.3
Note that above may fail if there is a dependency conflict (and fixing that is out of the OP's scope).
So, it doesn't matter that you are new to Vue as long as you know enough to prepare Laravel (and can ensure it's package.json does not conflict).

Related

how to test my tsdx ui library package locally on react.js project

i use tsdx to create a react ui library, and i want to test it on my next.js project before pushing it to the npm package.
i have try npm link , it works well in the beginning but when i change any thing in the package files it gave me an error, module not found, but it still in the node_modules folder.
i have try to run yarn install <tsdx-project-path > but it still gave me an error
so is there any way to include my tsdx ui library in my project locally.
let's think you have following folder structure.
|---/current-project
|---/tsdx-package
So you need to run npm install ../tsdx-package from inside current-project. I'm pretty sure you forgot to add ../ to your package path.

How to install globally installed npm packages

I wanted to try Vue js but it seems to be very hard for me to import it to my project. I there a way where you can install the dependencies without using internet (downloading again) which is already installed globally.
Vue 2 is installed globally and I will be using vue init, but it seems that vue init is installing the Vue again from the internet. I want it to take the dependencies from the already installed (globally) and put it in my folder so that I dont use internet.
Thanks in advance...
You can create a new project dir to store the globally installed package (copy from the installation folder) and after that copy process make a zip of it so that it can be used again, then you have to config some of the files for your project needs.
Try install localy and use command
npx vue <command>
Also check package.json in your project

Managing javascript dependencies

I am using Yarn. I have a project that needs the latest developments of the deck.gl project (i.e. something that has not yet released).
I tried:
1- To clone the repo, build it and publish the different modules in a registries but I (legitimately) do not own the #deck.gl scope - so it seems that route is not possible.
2- To clone the repo, build it and then add the various module directories to my project using:
yarn add file:/Users/alleon_g/0x-TechWork/deck.gl/modules/core/
but that seems to create issues with dependencies of that module
yarn add v1.13.0
[1/4] 🔍 Resolving packages...
error Couldn't find package "luma.gl#^7.0.0-alpha.14" required by "file:/Users/alleon_g/0x-TechWork/deck.gl/modules/core/" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
What is the proper way of using the latest modules of a project that has not yet published its components?
Guillaume

How to use a VueJS .vue component in a HTML page without a WebPack build process?

I am creating a page for a legacy server rendered project.
On one of its page I need to add some "dynamic". Then i import the vuejs CDN script and created a inline vue object
var v = new Vue(...
But there is a .vue component that I like very much and I would like to add it to the page. But it seems that this component can only be added by a WebPack import and build process.
How can I use this component in my html page without WebPack build process? Is that possible?
You can use poi as described in this article:
poi build Component.vue --format cjs
You can also use vue-cli 3 (beta) and the necessary global addon:
npm install -g #vue/cli
npm install -g #vue/cli-service-global
# or
yarn global add #vue/cli
yarn global add #vue/cli-service-global
vue build Component.vue
Use vue build --help to get options and the help text.
But be aware that this generates production minified code with an app and vendor bundle (which includes vue).
See also this old answer to a similar question, mentioning the use of the previous build command in vue-cli 2.8.x

How to create a react project with specific version of create-react-app?

I need to create a new react application with create-react-app version 1.0.10. However, when I do create-react-app myProject it automatically uses the latest version of create-react-app available at that time. Is there any commands available to make create-react-app use a specific version to create a project template?
You will need to run:
npm install --save --save-exact react-scripts#1.0.10
or
yarn add --exact react-scripts#1.0.10
this will only work in in a project that has not been ejected yet, read this for more info

Categories