Ongoing problems with Laravel quickstart

Mike Atkinson 101 Reputation points
2021-04-19T08:36:16.557+00:00

Hi,

I opened a ticket about this issiue last week but it was redirected to an earlier ticket I opened that is not related (and is now fixed). This is a different fault condition, I'd really appreciate any help you can offer. Thanks

I'm following the tutorial at:
https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-linux

Everything seems to work until I get to the 'Push to Azure from Git' step. At that point, I get:

remote: > Illuminate\Foundation\ComposerScripts::postInstall
remote: > php artisan optimize
remote: Generating optimized class loader
remote: ..............
remote: The compiled services file has been removed.
remote: Running npm install
remote: npm ERR! install Couldn't read dependencies
remote: npm ERR! Error: No 'name' field
remote: npm ERR! at validName (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:493:40)
remote: An error has occurred during web site deployment.
remote: npm ERR! at final (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:283:27)
remote: npm failed
remote: npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:115:33
remote: npm ERR! at cb (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\slide\lib\async-map.js:48:11)
remote: npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:237:40
remote: npm ERR! at [object Object].<anonymous> (fs.js:123:5)
remote: npm ERR! at [object Object].emit (events.js:64:17)
remote: npm ERR! at fs.js:1190:12
remote: npm ERR! at Object.oncomplete (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:94:5)
remote: npm ERR! [Error: No 'name' field]
remote: npm ERR! You may report this log at:
remote: npm ERR! <http://github.com/isaacs/npm/issues>
remote: npm ERR! or email it to:
remote: npm ERR! <******@googlegroups.com>
remote:
remote: npm ERR! System Windows_NT 6.2.9200
remote: npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--production"
remote: npm ERR! cwd C:\home\site\wwwroot
remote: npm ERR! node -v v0.6.20
remote: npm ERR! npm -v 1.1.37
remote: npm ERR! message No 'name' field
remote: npm
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.

Any help or suggestions as to how to debug would be much appreciated

TIA

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2021-04-20T17:21:59.657+00:00

    Hi @Mike Atkinson ,

    There are issues with the current tutorial as it hasn't been updated in 4 years. I would try running php composer.phar install from D:\home\site\wwwroot> on Kudu console and check for errors.

    I received Try to access array offset on value of type null error exception at which case I ran

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"  
    php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"  
    php composer-setup.php  
    php -r "unlink('composer-setup.php');"  
    

    to update composer.phar; see https://github.com/composer/composer/issues/8324 and ran php composer.phar install again.

    This is partially due to Composer not readily available on Windows hosted app as opposed to Linux hosted app. Therefore, you may have better luck with a Linux deployment. If do go that route, remove .deployment file from the repo as that's for getting Composer setup on the Windows host machine.

    The doc author is aware of this issue and will update the doc.

    Regards,
    Ryan


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.