我安装了以下软件包:
https://github.com/JeffreyWay/laravel-elixir-stylus
它正在发挥作用。现在我想用手写笔丢失https://github.com/peterramsing/lost。所以我补充说,但它不起作用。
我的 package.json:
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"bootstrap-sass": "^3.3.0",
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"laravel-elixir-stylus": "^1.0.1",
"postcss": "^5.0.21",
"poststylus": "^0.2.3"
}
}
gulpfile.js
var elixir = require('laravel-elixir');
var postStylus = require('poststylus');
elixir(function(mix) {
mix.stylus('app.styl', null, {
use: [postStylus(['lost', 'postcss-position'])]
});
});
当我尝试npm安装时,我收到错误:
npm WARN unmet dependency /Users/Janssen/Code/forum/node_modules/autoprefixer-core requires postcss@'~4.1.12' but will load
npm WARN unmet dependency /Users/egen/Code/forum/node_modules/postcss,
npm WARN unmet dependency which is version 5.0.21
npm WARN unmet dependency /Users/egen/Code/forum/node_modules/gulp-autoprefixer requires postcss@'^4.1.5' but will load
npm WARN unmet dependency /Users/egen/Code/foru
当我吞下gulp时,我会收到:
Cannot find module 'postcss-position'
我该怎么办?
答案 0 :(得分:0)
很遗憾,您无法同时使用手写笔与Laravel Elixir版本6。 我正在使用的解决方法是更改package.json和gulpfile,如果我想切换它。例如 如果我想使用新的Laravel 5.3前端功能,我必须修改
的package.json
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"babel-preset-es2015": "6.9.0",
"gulp": "^3.9.1",
"jquery": "^3.1.1",
"laravel-elixir": "^6.0.0-11",
"laravel-elixir-stylus": "^1.0.0",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-vueify": "^2.0.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.14.0",
"vue": "^1.0.26",
"vue-resource": "^1.0.2"
}
}
Gulpfile.js
var elixir = require('laravel-elixir');
require('laravel-elixir-webpack-official');
elixir(function(mix) {
//mix.webpack('app.js');
});
如果我想使用手写笔
的package.json
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"babel-preset-es2015": "6.9.0",
"gulp": "^3.9.1",
"jquery": "^3.1.1",
**"laravel-elixir": "^5.0.0-11",**
"laravel-elixir-stylus": "^1.0.0",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-vueify": "^2.0.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.14.0",
"vue": "^1.0.26",
"vue-resource": "^1.0.2"
}
}
Gulpfile.js
var elixir = require('laravel-elixir');
require('laravel-elixir-stylus');
elixir(function(mix) {
mix.stylus('app.stylus');
});
这是我一直在使用的解决方法,我们将不得不等待Jeffrey Way更新核心Laravel Elixir文件以包含手写笔组件。