Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access admin panel from cloned strapi application #1892

Closed
atlas365 opened this issue Sep 4, 2018 · 13 comments
Closed

Cannot access admin panel from cloned strapi application #1892

atlas365 opened this issue Sep 4, 2018 · 13 comments
Assignees

Comments

@atlas365
Copy link

atlas365 commented Sep 4, 2018

Informations

  • Node.js version: 10.8.0
  • npm version:6.2.0
  • Strapi version:3.0.0-alpha.14
  • Database:Mongo
  • Operating system:OSX

What is the current behavior?
Cannot access the admin panel from a strapi application that was cloned from a git repo.

Steps to reproduce the problem
My team is trying to standardize strapi setup for the dev environment. One of our members has gone through the process of building users, permissions, roles, controllers and has populated the mongo db. I have pulled down her work and used mongorestore to populate my mongo instance with what she had in her tables. The endpoints work fine but I cannot access the admin panel or the login screen. I only see the index.html page.

What is the expected behavior?
I think I should be able to log in using the admin user in the database and access the admin panel. Why is strapi always routing to index.html?

@TokenChingy
Copy link
Contributor

Have you done the following?

  • npm install in the project root directory.
  • npm run setup in the project root directory.

@derrickmehaffy
Copy link
Member

@atlas365 make sure you purge the package-lock.json file (if there is one) then run npm run setup

@atlas365
Copy link
Author

atlas365 commented Sep 4, 2018

Ok so running npm run setup got me access to the admin panel, but I don't see any plugins..
screen shot 2018-09-04 at 11 39 59 am

I ran npm install inside each of the plugins but still nothing. Is there another setup method I need to run?

@derrickmehaffy
Copy link
Member

@atlas365 that looks like something is very broken. Is this project public on github somewhere? My guess is that the build folders aren't being uploaded so you may need to run npm run setup:build (I haven't done this on a non --dev project so I have no clue if that will actually rebuild them)

@atlas365
Copy link
Author

atlas365 commented Sep 4, 2018

Unfortunately this isn't on a public github. And I tried to run 'npm run setup:build' but I got an error message saying 'missing script: setup:build' and I didn't see an option for setup:build in the package.json.

@derrickmehaffy
Copy link
Member

Yeah @atlas365 typically that is only for --dev projects. If you look on the private repo in plugins/content-manager/admin/build you should see a ton of files in there. If that directory isn't there or there is no files then it wasn't properly uploaded.

@atlas365
Copy link
Author

atlas365 commented Sep 4, 2018

Yeah no build folder. I can see it's being ignored in the .npmignore. Is the best way to fix that to change the .npmignore? Should I restart my project using --dev?

@atlas365
Copy link
Author

atlas365 commented Sep 4, 2018

Oh wait nevermind that's not gitignore

@derrickmehaffy
Copy link
Member

@atlas365 no don't use --dev unless you are modifying the adminUI.

.npmignore shouldn't matter, but if it is in .gitignore then remove it. You should however be able to create a new project and grab all the api/*/models/*.settings.json files and dump them into the new project to quickly spin up a new one so long as there were no major modifications.

@atlas365
Copy link
Author

atlas365 commented Sep 4, 2018

Perfect I think that's what I'm going to do then. Thank you very much for your helpful and very timely replies!

@KrunalDholakiya
Copy link

Even after following above given steps, I'm also facing this issue:
🏗 Building the admin...
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! strapi-admin@3.0.0-alpha.25.2 build: cross-env APP_PATH=$APP_PATH npm run build:dll && cross-env NODE_ENV=production IS_ADMIN=true ./node_modules/strapi-helper-plugin/node_ modules/.bin/webpack --config ./node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the strapi-admin@3.0.0-alpha.25.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/gkadmin/.npm/_logs/2019-05-16T19_25_37_469Z-debug.log

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! strapi-admin@3.0.0-alpha.25.2 setup: node ./scripts/setup.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the strapi-admin@3.0.0-alpha.25.2 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/gkadmin/.npm/_logs/2019-05-16T19_25_41_341Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! API@0.1.0 setup: cd admin && npm run setup
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the API@0.1.0 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/gkadmin/.npm/_logs/2019-05-16T19_25_41_382Z-debug.log
gkadmin@kanban00:~/tfs_trello/API$ tail -f /home/gkadmin/.npm/_logs/2019-05-16T19_25_41_341Z-debug.log
22 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "setup"
23 verbose node v11.14.0
24 verbose npm v6.9.0
25 error code ELIFECYCLE
26 error errno 1
27 error strapi-admin@3.0.0-alpha.25.2 setup: node ./scripts/setup.js
27 error Exit status 1
28 error Failed at the strapi-admin@3.0.0-alpha.25.2 setup script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]

@FarhadMohseni
Copy link

i got this solved by using npx strapi build in the root directory

@oscarBack
Copy link

I got this solved by deleting the build folder from .gitignore file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants