developeruz / yii-vue-app Goto Github PK
View Code? Open in Web Editor NEWThis project forked from yiisoft/yii2-app-basic
Yii 2.0 + Vue.js 2.x Application Template
License: BSD 3-Clause "New" or "Revised" License
This project forked from yiisoft/yii2-app-basic
Yii 2.0 + Vue.js 2.x Application Template
License: BSD 3-Clause "New" or "Revised" License
I would like to run this application by using vagrant and linux virtualbox with only Node installed, but I am constantly having issues with npm run dev
script.
At the start I was using "scotch/box-pro-nginx" box but I thought that nginx is making me issues due to occupied port 80, so I decided to go with simple box that comes with nothing installed.
Vagrant file:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.box_version = "20190807.0.0"
config.vm.network "private_network", ip: "192.168.33.18"
config.vm.hostname = "vue"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
config.vm.provision "shell", path: "vagrant/provision.sh", privileged: true
end
I installed:
Node: 10.16.2
Npm: 6.9.0
I run npm install
which finished successfully and then I tried to tun npm run dev
, but I am getting following error.
Maybe it is not really an issue of this project but I would like to know why I am not able to integrate this project inside linux. Is that possible at all?
I tried to run npm run dev
script on windows 10 with node/npm installed and it is working as intended, but I need that to be possible inside linux.
Thanks in advance.
Q | A |
---|---|
Yii vesion | |
PHP version | |
Operating system |
php composer.phar create-project --prefer-dist --stability=dev developeruz/yii-vue-app basic
composer install completed
Error while install:
> yarn install
...
> yarn dev
yarn run v1.6.0
$ cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
ERROR Failed to compile with 1 errors00:00:27
This dependency was not found:
* APP_PATH\app\app.js in multi ./app/app.js
To install it, you can run: npm install --save APP_PATH\app\app.js
Asset Size Chunks Chunk Names
/app.js 2.65 kB 0 [emitted] /app
ERROR in multi ./app/app.js
Module not found: Error: Can't resolve 'babel-loader' in 'APP_PATH'
@ multi ./app/app.js
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
Script yarn dev handling the post-create-project-cmd event returned with error code 1
Q | A |
---|---|
Yii vesion | 2.0.15.1 |
PHP version | 7.0 |
Operating system | Linux/Windows |
This happens immediately after running the installation:
php composer.phar create-project --prefer-dist --stability=dev developeruz/yii-vue-app
My terminal shows:
To install it, you can run: npm install --save /Users/diegotejadav/Documents/MAMP/htdocs/yii2vue2/app/app.js
Asset Size Chunks Chunk Names
/app.js 2.64 kB 0 [emitted] /app
ERROR in multi ./app/app.js
Module not found: Error: Can't resolve 'babel-loader' in '/Users/diegotejadav/Documents/MAMP/htdocs/yii2vue2'
@ multi ./app/app.js
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Script yarn dev handling the post-create-project-cmd event returned with error code 1
A succesfull installation without errors
The shown error
Q | A |
---|---|
Yii vesion | 2 |
PHP version | 7.1.16 |
Operating system | macOS HighSierra (10.13.6) |
After googling for the error, I found this stack overflow answer, and after adding the babel dependencies to the package.json:
"devDependencies": {
"cross-env": "^3.2.3",
"laravel-mix": "2.1",
"webpack": "3.11",
"babel": "^5.8.23",
"babel-core": "^5.0.0",
"babel-loader": "^5.3.2"
},
And running again yarn install, it ends successfully:
yarn install v1.9.4
[1/4] ๐ Resolving packages...
warning babel > babel-core > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
warning "laravel-mix > [email protected]" has unmet peer dependency "imagemin@^5.0.0".
warning " > [email protected]" has incorrect peer dependency "webpack@1 || 2 || ^2.1.0-beta".
[4/4] ๐ Building fresh packages...
success Saved lockfile.
โจ Done in 13.27s.
So, @developeruz is it needed to add the babel dependencies to the code of this repository?
I'm not sure if the babel versions are the correct.
int the package.json i added the following script to achieve hot mode:
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
then i run the command "yarn hot".
but when ever a vue template is updated, no changed occurred to the browser!
How to fix this issue?
Thank you
Had tried to install this project by command composer create-project --prefer-dist --stability=dev developeruz/yii-vue-app try-vue
On last step of installation i got error:
> yarn dev
yarn run v1.7.0
$ cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
95% emitting ERROR Failed to compile with 1 errors14:56:30
This dependency was not found:
* /sites/try-vue/app/app.js in multi ./app/app.js
To install it, you can run: npm install --save /sites/try-vue/app/app.js Asset Size Chunks Chunk Names
/app.js 2.6 kB 0 [emitted] /app
ERROR in multi ./app/app.js
Module not found: Error: Can't resolve 'babel-loader' in '/sites/try-vue'
@ multi ./app/app.js
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Script yarn dev handling the post-create-project-cmd event returned with error code 1
What's wrong?
Trying to Install the template via composer.
Template to be installed correctly.
Stuck at 95% emitting on yarn dev
Q | A |
---|---|
Yii vesion | 2.0.15.1 |
PHP version | 7.1.15 |
Operating system | Windows 10 |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.