javascript - Running gulp gives "path.js:7 throw new TypeError('Path must be a string. Received ' + inspect(path));" -


in wordpress project i'm using laravel elixir deal assets. working till today.

now every time run gulp i'm getting:

$ gulp path.js:7     throw new typeerror('path must string. received ' + inspect(path));     ^  typeerror: path must string. received { includepaths:    [ 'bower_components/foundation-sites/scss/',      'bower_components/slick-carousel/slick' ] }     @ assertpath (path.js:7:11)     @ object.join (path.js:1211:7)     @ prefixone (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/tasks/gulppaths.js:143:43)     @ gulppaths.prefix (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/tasks/gulppaths.js:153:20)     @ gulppaths.src (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/tasks/gulppaths.js:44:25)     @ getpaths (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/tasks/recipes/sass.js:33:33)     @ function.<anonymous> (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/tasks/recipes/sass.js:21:33)     @ function.<anonymous> (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/bootstrap/enableextension.js:16:18)     @ /users/slick/code/komarnicki2/wp-content/themes/komarnicki/gulpfile.js:7:9     @ global.elixir (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/laravel-elixir/dist/index.js:21:5) 

enter image description here

i thought maybe there wrong node_modules directory, did rm -rf node_modules , npm install usual. pulled @ end saw:

├── unmet peer dependency stream-browserify@* 

enter image description here

i have no idea whether unmet dependency reason. if can help, output of particular versions of software have:

node -v

v7.0.0

npm -v

3.10.8

gulp -v

[12:26:22] cli version 3.9.1 [12:26:22] local version 3.9.1

here my gulpfile.js.

it doesn't array includepaths? can ask help? thank you.

edit:

this package.json:

{   "name": "slick",   "version": "1.0.0",   "devdependencies": {     "gulp": "^3.9.1",     "laravel-elixir": "^6.0.0-2"   } } 

this solution helped me: https://stackoverflow.com/a/40047852/4197938

the problem options have been moved third fourth parameter.

so added additional null before includepaths.

mix.sass('app.scss', null, null <- solution, {

then running gulp gave

$ gulp [13:15:29] using gulpfile ~/code/komarnicki2/wp-content/themes/komarnicki/gulpfile.js [13:15:29] starting 'all'... [13:15:29] starting 'sass'... [13:15:29] 'sass' errored after 60 ms [13:15:29] error: missing binding /users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/node-sass/vendor/darwin-x64-51/binding.node node sass not find binding current environment: os x 64-bit node.js 7.x  found bindings following environments:   - os x 64-bit node.js 6.x  happens because environment has changed since running `npm install`. run `npm rebuild node-sass` build binding current environment.     @ object.<anonymous> (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/node-sass/lib/index.js:15:11)     @ module._compile (module.js:573:32)     @ object.module._extensions..js (module.js:582:10)     @ module.load (module.js:490:32)     @ trymoduleload (module.js:449:12)     @ function.module._load (module.js:441:3)     @ module.require (module.js:500:17)     @ require (internal/module.js:20:19)     @ object.<anonymous> (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/gulp-sass/index.js:187:21)     @ module._compile (module.js:573:32) [13:15:29] 'all' errored after 63 ms [13:15:29] error in plugin 'run-sequence(sass)' message:     missing binding /users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/node-sass/vendor/darwin-x64-51/binding.node node sass not find binding current environment: os x 64-bit node.js 7.x  found bindings following environments:   - os x 64-bit node.js 6.x  happens because environment has changed since running `npm install`. run `npm rebuild node-sass` build binding current environment. stack: error: missing binding /users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/node-sass/vendor/darwin-x64-51/binding.node node sass not find binding current environment: os x 64-bit node.js 7.x  found bindings following environments:   - os x 64-bit node.js 6.x  happens because environment has changed since running `npm install`. run `npm rebuild node-sass` build binding current environment.     @ object.<anonymous> (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/node-sass/lib/index.js:15:11)     @ module._compile (module.js:573:32)     @ object.module._extensions..js (module.js:582:10)     @ module.load (module.js:490:32)     @ trymoduleload (module.js:449:12)     @ function.module._load (module.js:441:3)     @ module.require (module.js:500:17)     @ require (internal/module.js:20:19)     @ object.<anonymous> (/users/slick/code/komarnicki2/wp-content/themes/komarnicki/node_modules/gulp-sass/index.js:187:21)     @ module._compile (module.js:573:32) 

so did written in output

npm rebuild node-sass

and gulp did work

$ gulp [13:20:18] using gulpfile ~/code/komarnicki2/wp-content/themes/komarnicki/gulpfile.js [13:20:18] starting 'all'... [13:20:18] starting 'sass'... [13:20:19] finished 'sass' after 900 ms [13:20:19] starting 'scripts'... [13:20:19] finished 'scripts' after 96 ms [13:20:19] starting 'copy'... [13:20:19] finished 'copy' after 52 ms [13:20:19] starting 'version'... [13:20:19] finished 'version' after 56 ms [13:20:19] finished 'all' after 1.11 s [13:20:19] starting 'default'... ┌───────────────┬──────────────────────────┬─────────────────────────────────────────────────────────────────────────────┬────────────────────┐ │ task          │ summary                  │ source files                                                                │ destination        │ ├───────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼────────────────────┤ │ mix.sass()    │ 1. compiling sass        │ assets/sass/app.scss                                                        │ public/css/app.css │ │               │ 2. autoprefixing css     │                                                                             │                    │ │               │ 3. concatenating files   │                                                                             │                    │ │               │ 4. writing source maps   │                                                                             │                    │ │               │ 5. saving destination │                                                                             │                    │ ├───────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼────────────────────┤ │ mix.scripts() │ 1. concatenating files   │ bower_components/fontfaceobserver/fontfaceobserver.js                       │ public/js/all.js   │ │               │ 2. writing source maps   │ assets/js/font.loader.js                                                    │                    │ │               │ 3. saving destination │ bower_components/jquery/dist/jquery.min.js                                  │                    │ │               │                          │ bower_components/foundation-sites/dist/foundation.min.js                    │                    │ │               │                          │ bower_components/moment/moment.js                                           │                    │ │               │                          │ bower_components/moment/locale/pl.js                                        │                    │ │               │                          │ bower_components/blazy/blazy.js                                             │                    │ │               │                          │ bower_components/jquery-viewport-checker/dist/jquery.viewportchecker.min.js │                    │ │               │                          │ bower_components/slick-carousel/slick/slick.min.js                          │                    │ │               │                          │ bower_components/masonry/dist/masonry.pkgd.js                               │                    │ │               │                          │ bower_components/imagesloaded/imagesloaded.pkgd.js                          │                    │ │               │                          │ bower_components/magnific-popup/dist/jquery.magnific-popup.js               │                    │ │               │                          │ assets/js/scripts.js                                                        │                    │ │               │                          │ assets/js/modules/*.js                                                      │                    │ │               │                          │ assets/js/other/*.js                                                        │                    │ ├───────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼────────────────────┤ │ mix.copy()    │ 1. saving destination │ assets/fonts//**/*                                                          │ public/fonts/      │ ├───────────────┼──────────────────────────┼─────────────────────────────────────────────────────────────────────────────┼────────────────────┤ │ mix.version() │ 1. versioning            │ public/css/app.css                                                          │ public/build       │ │               │ 2. rewriting file paths  │ public/js/all.js                                                            │                    │ │               │ 3. saving destination │                                                                             │                    │ │               │ 4. copying source maps   │                                                                             │                    │ └───────────────┴──────────────────────────┴─────────────────────────────────────────────────────────────────────────────┴────────────────────┘ [13:20:19] finished 'default' after 6.65 ms 

i still have no idea why happened. because messing brew stuff while creating my shell scripts (brew install node)? it's great problem solved i'm unhappy not knowing caused it. still can contribute , tell me went wrong?

  • why syntax has been changed?
  • why array of paths went 4-th place in list of args?
  • how can avoid in future?
  • what if decide add 5th, 6th arg?

was because of dependency version mismatch? i'm affraid can happen in future well...


Comments

Popular posts from this blog

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - SSE Emitter : Manage timeouts and complete() -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -