jasester

2818 经验值

重新npm install 之后也是这样
这个是我package.json文件

{
  "private": true,
  "scripts": {
    "dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.2",
    "bootstrap-sass": "^3.3.7",
    "jquery": "^3.1.0",
    "laravel-mix": "^0.6.0",
    "lodash": "^4.16.2",
    "vue": "^2.0.1"
  }
}

在laravel中使用Laravel Mix 的时候执行

npm run dev

报出如下错误

F:\WWW\msdt>npm run dev

> @ dev F:\WWW\msdt
> node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

module.js:471
    throw err;
    ^

Error: Cannot find module 'F:\WWW\msdt\node_modules\cross-env\bin\cross-env.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Jase\AppData\Roaming\npm-cache\_logs\2017-07-31T02_02_00_644Z-debug.log

laravel 版本号5.4.9
操作系统 windows8.1 64位

还想问一句,什么时候出视频啊,等的已经饥渴难耐了

已经解决了,我没有使用domain,只是在apache设置了一下

ServerAlias *.juda.dev

然后在host文件指定了一下ip,然后就可以了,感谢及时回答

如题在路由中使用了domain的时候报出如下的错误
default

路由

Route::group(['domain' => '{account}.juda.dev'], function () {
    Route::get('user/{id}', function ($account, $id) {
        dd($id);
    });
});

域名配置

<VirtualHost *:80>
    DocumentRoot "F:\WWW\juda\public"
    ServerName juda.dev
</VirtualHost>
<Directory "F:\WWW\juda\public">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

开发环境
php 版本5.6.27和7.1.7
laravel版本5.4.30
apache2.4
windows系统 win8.1

我这样写就报错了

Users::select(DB::raw('*, (st_distance (point (lng, lat),point('.$lng.','.$lat.') ) * 111195 / 1000) AS
                 distance'))->where('distance', '<=', 50)->orderBy('distance')->paginate(1);

还有就是我想问st_distance 这个是什么意思?

如题下面是sql语句

SELECT *,( 3959 * ACOS( COS( RADIANS('42.267124') ) * COS( RADIANS( lat ) ) * COS( RADIANS( lng ) - RADIANS('118.952568') ) + SIN( RADIANS('42.267124') ) * SIN( RADIANS( lat ) ) ) ) AS distance FROM `users` having distance <= 50 order by distance asc limit 0,9

这个sql语句要怎么转成Eloquent ORM格式?

还有这个语句在phpmyadmin中执行是可以执行的。
mysql版本5.6
laravel版本5.4
windows系统

已经解决了,但不知道是不是正确的但是可以查出来

SELECT * FROM `users` WHERE replace(`name`,' ','') = '张三',
SELECT * FROM `users` WHERE replace(`name`,' ','') like '%张三%'

都可以查出来,但不知道这样的写法是不是正确的?