首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >laravel-elixir导致` `npm install`出错,无法运行`gup`

laravel-elixir导致` `npm install`出错,无法运行`gup`
EN

Stack Overflow用户
提问于 2018-04-04 23:11:22
回答 1查看 665关注 0票数 1

我在将laravel-elixir添加到我的package.json文件以运行gulp时遇到问题。当我运行命令$ gulp时,我收到一个错误,指出找不到laravel-elixir模块。因此,将模块添加到我的package.json文件中,然后运行npm install会导致错误。(在没有package.json中的laravel-elixir模块的情况下,npm install运行良好)

我已经通读了所有的文档,并确保一切都安装好了。从我的研究来看,这似乎是一个问题(如果这可能是一个模棱两可的问题,我很抱歉)。我似乎就是找不到解决办法。如果您需要查看错误或其他信息,请发表评论并让我知道。

package.json

代码语言:javascript
复制
{
"private": true,
"devDependencies": {
"gulp": "^3.9.1",
"gulp-bower": "0.0.13",
"run-sequence": "^1.2.2",
"babel-cli": "^6.7.7",
"babel-preset-es2015": "^6.9.0",
"chai": "^3.5.0",
"laravel-elixir-browserify-official": "^0.1.3",
"laravel-elixir-coffeescript": "^1.0.2",
"laravel-elixir-rollup-official": "^1.0.4",
"laravel-elixir-stylus": "^2.0.2",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-webpack-official": "^1.0.1",
"mocha": "^2.4.5",
"rimraf": "^2.5.2",
"laravel-elixir": "^4.0.0"
},
"dependencies": {
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"es2015": "0.0.0",
"gulp-install": "^1.1.0",
"react": "^0.14.6",
"vue": "^1.0.28",
"vue-resource": "^0.5.1",
"vue-router": "^0.7.13",
"vue-validator": "^2.1.7",
"gulp-coffee": "^2.3.1",
"clean-css": "^3.4.12",
"cli-table": "^0.3.1",
"del": "^2.2.0",
"glob": "^7.0.3",
"gulp-autoprefixer": "^3.1.0",
"gulp-batch": "^1.0.5",
"gulp-concat": "^2.6.0",
"gulp-if": "^2.0.0",
"gulp-less": "^3.0.5",
"gulp-load-plugins": "^1.2.2",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-rev": "^7.0.0",
"gulp-rev-replace": "^0.4.3",
"gulp-sass": "^3.1.0",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"parse-filepath": "^1.0.1",
"path": "^0.12.7",
"q": "^1.4.1",
"require-dir": "^0.3.2",
"run-sequence": "^1.1.5",
"underscore": "^1.8.3",
"vinyl-map2": "^1.2.1"
}
}

Gulp文件

代码语言:javascript
复制
var gulp = require("gulp");
var bower = require("gulp-bower");
var elixir = require("laravel-elixir");

gulp.task('bower', function () {
return bower();
});
/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 */
var vendors = '../../../bower_components/';

var paths = {
'jquery': vendors + 'jquery/dist',
'jqueryUi': vendors + 'jquery-ui',
'moment': vendors + 'moment',
'bootstrap': vendors + 'bootstrap/dist',
'dataTables': vendors + 'datatables/media',
'jquerycookie': vendors + 'jquery.cookie',
'fontawesome': vendors + 'font-awesome',
'animate': vendors + 'animate.css',
'underscore': vendors + 'underscore',
'tether': vendors + 'tether/dist',
'jQueryStorageAPI': vendors + 'jQuery-Storage-API',
'pace': vendors + 'PACE',
'lazyload': vendors + 'lazyload',
'screenfull': vendors + 'screenfull/dist',
'select2': vendors + 'select2/dist',
'select2TabFix': vendors + 'select2-tab-fix',
'eonasdanBootstrapDatetimepicker': vendors + 'eonasdan-bootstrap-datetimepicker/build',
'fullcalendar': vendors + 'fullcalendar/dist',
'summernote': vendors + 'summernote/dist',
'morris': vendors + 'morris.js',
'raphael': vendors + 'raphael',
'algoliasearch': vendors + 'algoliasearch/dist/',
'algoliaAutocomplete': vendors + 'algolia-autocomplete.js/dist/',
'typeahead': vendors + 'typeahead.js/dist/',
'pusher': vendors + 'pusher/dist/',
'icheck': vendors + 'iCheck',
'jasnyBootstrap': vendors + 'jasny-bootstrap/dist',
'toastr': vendors + 'toastr/',
'dropzone': vendors + 'dropzone/dist',
'select2BootstrapTheme': vendors + 'select2-bootstrap-theme/dist',
'c3': vendors + '/c3/'
};

elixir.config.sourcemaps = false;

elixir(function (mix) {

// Run bower install
mix.task('bower');

//Custom Styles
mix.styles(
    [
       'lcrm_bootstrap.css', 'metisMenu.min.css', 'lcrm.css', 'mail.css'
    ], 'public/css/secure.css');

//Custom Javascript
mix.browserify(['app.js'], 'public/js/secure.js');


/**
 * Vendor files
 * run "gulp --production"
 */
if (elixir.config.production) {
    // Copy js straight to public
    mix.copy('resources/assets/js/metisMenu.min.js', 'public/js');
    mix.copy('resources/assets/js/datetime-moment.js', 'public/js');
    mix.copy('resources/assets/js/lcrm_app.js', 'public/js');
    mix.copy('resources/assets/js/todolist.js', 'public/js');

    // Copy fonts straight to public
    mix.copy('bower_components/bootstrap/fonts', 'public/fonts/bootstrap');
    mix.copy('bower_components/font-awesome/fonts', 'public/fonts');
    mix.copy('resources/assets/css/material-design-icons/iconfont', 'public/fonts');

    // Copy images straight to public
    mix.copy('bower_components/bootstrap-fileinput/img', 'public/img');
    mix.copy('bower_components/jquery-ui/themes/base/images', 'public/img');
    mix.copy('bower_components/datatables/media/images', 'public/img');

    mix.copy('resources/assets/img', 'public/img');
    mix.copy('resources/assets/images', 'public/images');
    mix.copy('resources/assets/img/logo.png', 'public/uploads/site');
    mix.copy('resources/assets/img/fav.ico', 'public/uploads/site');
    mix.copy('resources/assets/img/user.png', 'public/uploads/avatar');

    // copy js files ( we don't need to combine all files into single js)
    mix.copy('bower_components/screenfull/dist/screenfull.min.js', 'public/js');

    //c3&d3 chart css and js files
    mix.copy('bower_components/c3/c3.min.css', 'public/css');
    mix.copy('bower_components/c3/c3.min.js', 'public/js');
    mix.copy('bower_components/d3/d3.min.js', 'public/js');
    mix.copy('resources/assets/js/d3.v3.min.js', 'public/js');

    //jvector map files
    mix.copy('bower_components/bower-jvectormap/jquery-jvectormap-1.2.2.min.js', 'public/js');
    mix.copy('resources/assets/css/jquery-jvectormap.css', 'public/css');
    mix.copy('resources/assets/js/jquery-jvectormap-us-aea-en.js', 'public/js');

    //icheck
    mix.copy('resources/assets/css/icheck.css','public/css');
    mix.copy('bower_components/iCheck/icheck.min.js','public/js');

    //countUp
    mix.copy('bower_components/countUp.js/dist/countUp.min.js', 'public/js');

    //jQuery Sortable
    mix.copy('resources/assets/js/jquery-sortable.js', 'public/js');
    //CSS Libraries
    mix.styles([paths.fontawesome + "/css/font-awesome.min.css",
        paths.animate + "/animate.min.css",
        "resources/assets/css/material-design-icons/material-design-icons.css",
        paths.select2 + "/css/select2.min.css",
        paths.eonasdanBootstrapDatetimepicker + '/css/bootstrap-datetimepicker.css',
        'dataTables.bootstrap.css',
        paths.fullcalendar + '/fullcalendar.css',
        paths.summernote + '/summernote.css',
        paths.summernote + '/summernote-bs3.css',
        paths.morris + '/morris.css',
        paths.dropzone + '/dropzone.css',
        paths.jasnyBootstrap + "/css/jasny-bootstrap.min.css",
        paths.toastr + '/toastr.css',
        paths.select2BootstrapTheme + "/select2-bootstrap.min.css"
    ], 'public/css/libs.css');


    //JS Libraries
    mix.scripts([paths.jquery + "/jquery.js",
        paths.jqueryUi + "/jquery-ui.min.js",
        paths.tether + "/js/tether.min.js",
        paths.bootstrap + "/js/bootstrap.min.js",
        paths.dataTables + "/js/jquery.dataTables.min.js",
        paths.dataTables + "/js/dataTables.bootstrap.js",
        paths.jquerycookie + "/jquery.cookie.js",
        paths.pace + '/pace.min.js',
        paths.underscore + "/underscore-min.js",
        paths.select2 + "/js/select2.min.js",
        paths.select2TabFix + "/src/select2-tab-fix.min.js",
        paths.moment + '/moment.js',
        paths.eonasdanBootstrapDatetimepicker + '/js/bootstrap-datetimepicker.min.js',
        paths.fullcalendar + '/fullcalendar.js',
        paths.summernote + '/summernote.js',
        paths.morris + '/morris.js',
        paths.raphael + '/raphael.js',
        paths.algoliasearch + '/algoliasearch.min.js',
        paths.algoliaAutocomplete + '/autocomplete.min.js',
        paths.typeahead + '/typeahead.jquery.min.js',
        paths.pusher + '/pusher.js',
        paths.toastr + 'toastr.min.js',
        paths.jasnyBootstrap +  "/js/jasny-bootstrap.min.js",

        "palette.js"
    ], 'public/js/libs.js');
}
});

错误

代码语言:javascript
复制
npm install
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> node-sass@3.13.1 install C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
  try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

> uws@9.14.0 install C:\xampp\htdocs\trinet\node_modules\uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0


> node-sass@3.13.1 postinstall C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe 
C:\xampp\htdocs\trinet\node_modules\node-gyp\bin\node-gyp.js rebuild --          
verbose --libsass_ext= --libsass_cflags= --lib                                                                             
sass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\xampp\\htdocs\\trinet\\node_modules\\node- 
gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
    gyp info using node@8.11.1 | win32 | x64
    gyp verb command rebuild []
    gyp verb command clean []
    gyp verb clean removing "build" directory
    gyp verb command configure []
    gyp verb check python checking for Python executable 
    "C:/Users/user/AppData/Local/Programs/Python/Python37/python.exe" in the PATH
    gyp verb `which` succeeded 
    C:/Users/user/AppData/Local/Programs/Python/Python37/python.exe 
    C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe
    gyp verb check python version 
    `C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe -c "import platform; print(platform.python_version());"` retur                                                                             ned: "3.7.0b3\r\n"
gyp verb could not find "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe". checking python launcher
gyp verb could not find "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\xampp\htdocs\trinet\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\xampp\htdocs\trinet\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\xampp\htdocs\trinet\node_modules\node-gyp\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\trinet\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ex                                                                             t=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN buble-loader@0.2.2 requires a peer of buble@^0.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN vue-template-validator@1.1.5 requires a peer of parse5@^2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package run-sequence is included as both a dev and production dependency.
npm WARN The package babel-preset-es2015 is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}                                                                             )

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
EN

回答 1

Stack Overflow用户

发布于 2018-10-08 15:59:45

尝试先安装python,因为它正在搜索可执行文件,但找不到它

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49654573

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档