How can I set up Vue.js in my Laravel Project ? - javascript

I work with Laravel and I try to do something with Vue.js but I can't see it up.
First of all I install Node.js and npm.
Now I'm trying to user 'npm run watch'. To see if my js code runs on my laravel project.
But, when I type 'npm run watch' in my cmd. It's like this:
What should I do ?
Thanks !

It looks like your version of Laravel Mix is out-of-date; there was a bug fixed in March 2017 that addressed this issue on newer versions of webpack.
You can update your version of Laravel Mix by either doing this:
npm uninstall laravel-mix && npm install --save-dev laravel-mix
or updating your package.json file to change the version for laravel-mix
...
"devDependencies": {
...
"laravel-mix": "^0.11.4",
...
}
...
After changing the version number, run npm update.

Related

How to install a react-three/fiber and react-three/drei version compatible with "react": "^17.0.2"?

I having trouble with the installation of react-three/fiber and react-three/drei. Please tell me how to install a downgrade version of the two packages. I can't change the version of my react and react-dom because some packages might be affected by the changes.
You can target a specific version in the package.json file, try something like this:
package.json
"dependencies": {
...
"#react-three/fiber": "7.0.6"
"#react-trhee/drei": "7.5.1"
...
}
After the changes you will have to delete the node_modules and reinstall
Alternatively if you already uninstall/remove the packages, you can target specific versions by doing:
npm install [package]#[version]
or
yarn add [package]#[version]
For eaxmple npm install #react-three/fiber#7.0.6

Create React App with an older version of node

I am trying to use Create React App but getting an error that it requires Node 10 or higher. My node version is Node 8.10.0 and there's no way for me to update the Node version since it's a work machine. Is there any way to run an older version of Create React App to work with my older Node version?
I managed to run it. It seems like the last versions of the packages which support Node 8.x.x are 3.4.1 for create-react-app and 3.1.1 for react-scripts. What I did:
npm uninstall -g create-react-app
npm install -g create-react-app#3.4.1
create-react-app my-app --scripts-version 3.1.1
But it's better to update your Node version to the actual (or LTS at least).
From my understanding you can add the flag --scripts-version to your npx create-react-app command. So for example if you wanted to run react version 15.6 you would run something like:
npx create-react-app appname --scripts-version 1.0.14
You can reference the react-script repo as well as the NPM Package for more information on which version of the script you would want to run. Hopefully this helped! If not please let me know and I'm more than willing to try and look more into it.
Edit:
Forgot to mention that you need to make sure to change the versions of react and react dom within your package.json after. So after installing you would run:
npm i react#15.6
npm i react-dom#15.6

How to install same libraries in different name

I am Japanese web developer and I am not good at English , sorry.
I am using library by npm.
I forked the library and I remade it.
I changed my package.json like this.
"libraryName": "git+https://github.com/MyGitName/libraryName#master",
"npm install" worked properly.
But now I want to import same library in different name.
I want to subtend them by branches.
package.json
"libraryName1": "git+https://github.com/MyGitName/libraryName#master1",
"libraryName2": "git+https://github.com/MyGitName/libraryName#master2",
TypeScript
import library as libraryName1 from "libraryName1";
import library as libraryName2 from "libraryName2";
I want to do something like this.
Anyone know the way to do this?
What I tried.↓
1.yarn install -g
2.yarn add lodash2#npm:lodash#2.x
3.edit package.json like this.
"libraryName1": "git+https://github.com/MyGitName/libraryName#master1",
"libraryName2": "git+https://github.com/MyGitName/libraryName#master2",
4.yarn add libraryName1
↑ error occured.
This is not possible with npm currently. You could use yarn instead of npm to solve this. Otherwise you need to publish your own npm package.
package.json example to install both bootstrap 3 and 4. This only works with yarn.
"dependencies": {
"bootstrap": "^4.1.3",
"bootstrap3": "git://github.com/twbs/bootstrap#3.3.7"
}
Sources:
Install multiple versions of a dependency #5499
Yarn tip: You can alias a package by using...

ionic building TypeError: env.runcmd is not a function

During build of an ionic App, this error is shown:
anyone can help me ?
It says:
Error occurred during command execution from a CLI plugin
(#ionic/cli-plugin-cordova). Your plugins may be out of
date.
Did you try to install latest cordova plug-in :
$> npm install #ionic/cli-plugin-cordova#latest
Also update the dependencies....
Things to try:
run "cordova platform add ios" and "cordova platform add android"
run npm install --save --save-exact ionic#3.6.0 and then upgrade it to newest version
if it still does not work then just do downgrade without upgrade and wait until stable version will be released
In my case, I just change version package.json of this two plugins under devDependencies section. (In your case version number may differ)
"#ionic/cli-plugin-cordova" : "1.4.1",
"#ionic/cli-plugin-ionic-angular" : "1.3.2"
after this change in package.json run below command:
npm update
Now try to build, it's working.
The main problem for me was the #ionic/cli-plugin-cordova , so I downgraded it to v1.4.1 ( Don't know if any of the later versions are working fine.)
Command:
npm install --save-dev #ionic/cli-plugin-cordova#1.4.1
I my case what I did was went to the project folder and ran the following command to Get it working
cd platforms/ios/cordova && npm install ios-sim#latest

Is there an NPM location where I can download Gulp 4 or a pre-release of Gulp 4?

I'm using a package.son where I list all the Gulp NPM modules. In that file I have "gulp": "3.8.11",
I would like to use Gulp4 and I read here some different ways to access it:
http://stackoverflow.com/questions/33429727/how-do-i-install-gulp-4
But is it possible to also do this with a package.json? When I try to look at versions of "gulp" the auto part of Visual Studio doesn't prompt me for anything more than a 3.9 version.
Also is there a way that I could have some tasks use Gulp3 and others uses Gulp4?
Duplicate, but regardless:
npm install gulpjs/gulp#4.0 --save-dev
That adds this to the package.json:
"gulp": "gulpjs/gulp#4.0"
Here is the only solution that I could get to work:
"gulp-4.0.build": "4.0.0-build.a271520",
Note that the version details on the right were added automatically by Visual Studio.

Categories

Resources