sebbaum / generator-laravel-5

Scaffold Laravel 5.7 applications with ease.
Other
18 stars 0 forks source link

Error during generation #7

Closed azdanov closed 6 years ago

azdanov commented 6 years ago

I get this error after Package manifest generated successfully:

events.js:167
      throw er; // Unhandled 'error' event
      ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at makeCallback (fs.js:137:11)
    at Object.unlink (fs.js:917:14)
    at module.exports.composerScripts (/usr/local/lib/node_modules/generator-laravel-5/generators/app/index.js:89:8)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-laravel-5/node_modules/yeoman-generator/lib/index.js:399:25)
    at /usr/local/lib/node_modules/generator-laravel-5/node_modules/run-async/index.js:25:25
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/generator-laravel-5/node_modules/run-async/index.js:24:19
    at self.env.runLoop.add.completed (/usr/local/lib/node_modules/generator-laravel-5/node_modules/yeoman-generator/lib/index.js:400:11)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
Emitted 'error' event at:
    at Immediate.setImmediate (/usr/local/lib/node_modules/generator-laravel-5/node_modules/yeoman-generator/lib/index.js:406:18)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
Full Log ```sh yo laravel-5 2296ms < Mon Sep 10 08:50:56 2018 Let's create a new Laravel 5 application ? What's the name of your application? application ? Which Laravel version do you want to use? 5.7.* ? From where do you serve your application during development? php artisan serve (localhost:8080) ? Which laravel frontend preset do you want to use? none Installing laravel/laravel (v5.7.0) - Installing laravel/laravel (v5.7.0): Loading from cache Created project in application > @php -r "file_exists('.env') || copy('.env.example', '.env');" Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 71 installs, 0 updates, 0 removals - Installing vlucas/phpdotenv (v2.5.1): Loading from cache - Installing symfony/css-selector (v4.1.4): Loading from cache - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache - Installing symfony/polyfill-php72 (v1.9.0): Loading from cache - Installing symfony/polyfill-mbstring (v1.9.0): Loading from cache - Installing symfony/var-dumper (v4.1.4): Loading from cache - Installing symfony/routing (v4.1.4): Loading from cache - Installing symfony/process (v4.1.4): Loading from cache - Installing symfony/polyfill-ctype (v1.9.0): Loading from cache - Installing symfony/http-foundation (v4.1.4): Loading from cache - Installing symfony/event-dispatcher (v4.1.4): Loading from cache - Installing psr/log (1.0.2): Loading from cache - Installing symfony/debug (v4.1.4): Loading from cache - Installing symfony/http-kernel (v4.1.4): Loading from cache - Installing symfony/finder (v4.1.4): Loading from cache - Installing symfony/console (v4.1.4): Loading from cache - Installing doctrine/lexer (v1.0.1): Loading from cache - Installing egulias/email-validator (2.1.5): Loading from cache - Installing swiftmailer/swiftmailer (v6.1.2): Loading from cache - Installing paragonie/random_compat (v9.99.99): Loading from cache - Installing ramsey/uuid (3.8.0): Loading from cache - Installing psr/simple-cache (1.0.1): Loading from cache - Installing psr/container (1.0.0): Loading from cache - Installing symfony/translation (v4.1.4): Loading from cache - Installing nesbot/carbon (1.33.0): Loading from cache - Installing monolog/monolog (1.23.0): Loading from cache - Installing league/flysystem (1.0.46): Loading from cache - Installing erusev/parsedown (1.7.1): Loading from cache - Installing dragonmantank/cron-expression (v2.2.0): Loading from cache - Installing doctrine/inflector (v1.3.0): Loading from cache - Installing laravel/framework (v5.7.2): Loading from cache - Installing fideloper/proxy (4.0.0): Loading from cache - Installing nikic/php-parser (v4.0.3): Loading from cache - Installing jakub-onderka/php-console-color (0.1): Loading from cache - Installing jakub-onderka/php-console-highlighter (v0.3.2): Loading from cache - Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache - Installing psy/psysh (v0.9.8): Loading from cache - Installing laravel/tinker (v1.0.7): Loading from cache - Installing beyondcode/laravel-dump-server (1.2.1): Loading from cache - Installing fzaninotto/faker (v1.8.0): Loading from cache - Installing hamcrest/hamcrest-php (v2.0.0): Loading from cache - Installing mockery/mockery (1.1.0): Loading from cache - Installing filp/whoops (2.2.1): Loading from cache - Installing nunomaduro/collision (v2.0.3): Loading from cache - Installing sebastian/version (2.0.1): Loading from cache - Installing sebastian/resource-operations (1.0.0): Loading from cache - Installing sebastian/object-reflector (1.1.1): Loading from cache - Installing sebastian/recursion-context (3.0.0): Loading from cache - Installing sebastian/object-enumerator (3.0.3): Loading from cache - Installing sebastian/global-state (2.0.0): Loading from cache - Installing sebastian/exporter (3.1.0): Loading from cache - Installing sebastian/environment (3.1.0): Loading from cache - Installing sebastian/diff (3.0.1): Loading from cache - Installing sebastian/comparator (3.0.2): Loading from cache - Installing phpunit/php-timer (2.0.0): Loading from cache - Installing phpunit/php-text-template (1.2.1): Loading from cache - Installing phpunit/php-file-iterator (2.0.1): Loading from cache - Installing theseer/tokenizer (1.1.0): Loading from cache - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache - Installing phpunit/php-token-stream (3.0.0): Loading from cache - Installing phpunit/php-code-coverage (6.0.7): Loading from cache - Installing doctrine/instantiator (1.1.0): Loading from cache - Installing webmozart/assert (1.3.0): Loading from cache - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache - Installing phpdocumentor/reflection-docblock (4.3.0): Loading from cache - Installing phpspec/prophecy (1.8.0): Loading from cache - Installing phar-io/version (2.0.1): Loading from cache - Installing phar-io/manifest (1.0.3): Loading from cache - Installing myclabs/deep-copy (1.8.1): Loading from cache - Installing phpunit/phpunit (7.3.5): Loading from cache symfony/routing suggests installing doctrine/annotations (For using the annotation loader) symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader) symfony/routing suggests installing symfony/dependency-injection (For loading routes from a service) symfony/routing suggests installing symfony/expression-language (For using expression matching) symfony/routing suggests installing symfony/yaml (For using the YAML loader) symfony/event-dispatcher suggests installing symfony/dependency-injection symfony/http-kernel suggests installing symfony/browser-kit symfony/http-kernel suggests installing symfony/config symfony/http-kernel suggests installing symfony/dependency-injection symfony/console suggests installing symfony/lock swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed) paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.) ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter) ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator) ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator) ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).) ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.) ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid) symfony/translation suggests installing symfony/config symfony/translation suggests installing symfony/yaml monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB) monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server) monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required)) monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server) monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server) monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver) monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib) monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome) monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar) monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server) monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server) league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2) league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3) league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage) league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching) league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem) league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files) league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib) league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage) league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter) league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage) league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications) laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (^3.0).) laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (^2.6).) laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (^6.0).) laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (^1.0).) laravel/framework suggests installing league/flysystem-cached-adapter (Required to use the Flysystem cache (^1.0).) laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (^1.0).) laravel/framework suggests installing league/flysystem-sftp (Required to use the Flysystem SFTP driver (^1.0).) laravel/framework suggests installing moontoast/math (Required to use ordered UUIDs (^1.1).) laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (^1.0).) laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (^3.0).) laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (^1.0).) laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (^3.0).) laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (^4.1).) laravel/framework suggests installing symfony/psr-http-message-bridge (Required to psr7 bridging features (^1.0).) psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.) psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.) filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses) sebastian/global-state suggests installing ext-uopz (*) phpunit/phpunit suggests installing phpunit/php-invoker (^2.0) Writing lock file Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover Discovered Package: beyondcode/laravel-dump-server Discovered Package: fideloper/proxy Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. > @php artisan key:generate Application key [base64:fHNBE48sjUV2luzjf0Jx8CEhM8ma7YXJcHfvV99bsWQ=] set successfully. Using version ^2.8 for doctrine/dbal Using version ^2.5 for barryvdh/laravel-ide-helper Using version ^3.2 for barryvdh/laravel-debugbar Using version ^0.11.2 for barryvdh/laravel-cors Using version ^2.4 for phpmetrics/phpmetrics Using version ^1.0 for beyondcode/laravel-self-diagnosis ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 21 installs, 0 updates, 0 removals - Installing geerlingguy/ping (1.1.2): Loading from cache - Installing composer/semver (1.4.2): Loading from cache - Installing beyondcode/laravel-self-diagnosis (1.0.2): Loading from cache - Installing asm89/stack-cors (1.2.0): Loading from cache - Installing barryvdh/laravel-cors (v0.11.2): Loading from cache - Installing maximebf/debugbar (v1.15.0): Loading from cache - Installing barryvdh/laravel-debugbar (v3.2.0): Loading from cache - Installing symfony/filesystem (v4.1.4): Loading from cache - Installing seld/phar-utils (1.0.1): Loading from cache - Installing seld/jsonlint (1.7.1): Loading from cache - Installing justinrainbow/json-schema (5.2.7): Loading from cache - Installing composer/xdebug-handler (1.3.0): Loading from cache - Installing composer/spdx-licenses (1.4.0): Loading from cache - Installing composer/ca-bundle (1.1.2): Loading from cache - Installing composer/composer (1.7.2): Loading from cache - Installing barryvdh/reflection-docblock (v2.0.4): Loading from cache - Installing barryvdh/laravel-ide-helper (v2.5.1): Loading from cache - Installing doctrine/event-manager (v1.0.0): Loading from cache - Installing doctrine/cache (v1.8.0): Loading from cache - Installing doctrine/dbal (v2.8.0): Loading from cache - Installing phpmetrics/phpmetrics (v2.4.1): Loading from cache maximebf/debugbar suggests installing kriswallsmith/assetic (The best way to manage assets) maximebf/debugbar suggests installing predis/predis (Redis storage) barryvdh/reflection-docblock suggests installing dflydev/markdown (~1.0) doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver) Writing lock file Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover Discovered Package: barryvdh/laravel-cors Discovered Package: barryvdh/laravel-debugbar Discovered Package: barryvdh/laravel-ide-helper Discovered Package: beyondcode/laravel-dump-server Discovered Package: beyondcode/laravel-self-diagnosis Discovered Package: fideloper/proxy Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": "^7.1.3", "fideloper/proxy": "^4.0", "laravel/framework": "5.7.*", "laravel/tinker": "^1.0" }, "require-dev": { "barryvdh/laravel-cors": "^0.11.2", "barryvdh/laravel-debugbar": "^3.2", "barryvdh/laravel-ide-helper": "^2.5", "beyondcode/laravel-dump-server": "^1.0", "beyondcode/laravel-self-diagnosis": "^1.0", "doctrine/dbal": "^2.8", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpmetrics/phpmetrics": "^2.4", "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "minimum-stability": "dev", "prefer-stable": true } events.js:167 throw er; // Unhandled 'error' event ^ TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at makeCallback (fs.js:137:11) at Object.unlink (fs.js:917:14) at module.exports.composerScripts (/usr/local/lib/node_modules/generator-laravel-5/generators/app/index.js:89:8) at Object. (/usr/local/lib/node_modules/generator-laravel-5/node_modules/yeoman-generator/lib/index.js:399:25) at /usr/local/lib/node_modules/generator-laravel-5/node_modules/run-async/index.js:25:25 at new Promise () at /usr/local/lib/node_modules/generator-laravel-5/node_modules/run-async/index.js:24:19 at self.env.runLoop.add.completed (/usr/local/lib/node_modules/generator-laravel-5/node_modules/yeoman-generator/lib/index.js:400:11) at runCallback (timers.js:694:18) at tryOnImmediate (timers.js:665:5) Emitted 'error' event at: at Immediate.setImmediate (/usr/local/lib/node_modules/generator-laravel-5/node_modules/yeoman-generator/lib/index.js:406:18) at runCallback (timers.js:694:18) at tryOnImmediate (timers.js:665:5) at processImmediate (timers.js:647:5) ```

It doesn't seem to affect anything since there are no issues when serving the app via php artisan serve.

sebbaum commented 6 years ago

Hi @azdanov, thanks for reporting this potential bug. I cannot yet reproduce this error. Can you please tell me which version of nodejs/npm you are using?

nodejs -v and npm -v

Cheers Sebastian

azdanov commented 6 years ago

Might be relevant or not, but node is installed with homebrew.

node -v
v10.10.0

which node 
/usr/local/bin/node

npm -v 
6.4.1

which npm 
/usr/local/bin/npm

npm ls -g --depth=0

/usr/local/lib
├── alfred-emoj@1.0.0
├── alfred-fkill@0.4.0
├── alfred-npms@1.1.0
├── alfred-packagist@1.2.0
├── commitizen@2.10.1
├── cz-conventional-changelog@2.1.0
├── fkill-cli@5.0.0
├── generator-laravel-5@1.1.0
├── gitignore.cli@1.4.2
├── npm@6.4.1
├── npm-check@5.8.0
├── npm-quick-run@1.16.1
├── prettier@1.14.2
├── rimraf@2.6.2
├── serve@10.0.0
├── starring@0.2.1
└── yo@2.0.5
sebbaum commented 6 years ago

Cool, thanks. Now I can investigate this issue. I assume, that this is nodejs 10 related since I am still running nodejs 8.

I hope, that I can fix this as soon as possible.

azdanov commented 6 years ago

I've tried running the generator with node v8.11.4 LTS; npm 6.4.1 and everything went well. Although had some deprecation warnings about calling some async functions without a callback.

So now I know that in node 10 it fails on npm install.