Netlify is not deploying create-react-app - create-react-app

Apparantly it takes 30 seconds to deploy a react app on netlify!
https://www.netlify.com/blog/2016/07/22/deploy-react-apps-in-less-than-30-seconds/
I have followed exactly the following steps :
create-react-app hello-world2
cd hello-world2
npm run build
npm install netlify-cli -g
netlify deploy
The CLI then gives me a bunch of options. I selected the "." for publish directory. Is that right?
This is what is in my console :
I then go to :
https://5ed0fcc54e316210489aa68c--hellowworld2.netlify.app/
and I get :
How is this possible if I am following the steps exactly?

Create-React-App will build your app into production files that it places in the ./build folder - see docs here.
You need to tell Netlify to look in there, so set publish directory to build.

Related

AppCenter Yarn 1.19 error Incorrect integrity when fetching from the cache

I have a React Native app hosted on Microsoft App center. The builds (both iOS and android) are failing because of yarn 1.19 (error Incorrect integrity when fetching from the cache)
I tried to remove the package-lock.json but it didn't help.
I would like to downgrade yarn or execute the cache clean command but don't know where to execute it.
I have installed the appcenter cli version 2.2.1 and successfully connected to it.
Where could I execute yarn cache clean for example?
I've read I could also create a script but I have no idea where to place it and how it should look like. Should it be both in the ios and android directory? Or in the root? Thank you
I actually noticed that I had a yarn.lock back from the initial commit, even though we are using npm in the team.
In the build logs, there is this line:
/bin/sh -c if [ -f yarn.lock ]; then { yarn install && yarn list --depth=0; } else npm install; fi
So I deleted the yarn.lock file and now it builds successfully using npm!
Not sure whether you build your React app with Azure Devops pipeline. If yes, you can use Command line task to achieve the things you want to do.
If the agent you used is hosted agent during the build, since each build will use a completely new VM, you need to install the AppCenter cli once per build.
Use follow command to install the AppCenter cli:
sudo npm install -g appcenter-cli
Then logging in it:
appcenter login --token {Token}
Here, you need first generate the token with this doc described: Go and login to https://appcenter.ms/ -> Click Self Avatar -> Choose Account Settings -> Click on API Tokens -> Click New API token then select the corresponding the scope for this token.
Copy and use it in this pipeline task. Note: Recommend you store
this token with secret variable for security.
Now, you can execute the clean command: yarn cache clean.
Where to place it and how it should look like?
According to your description, you need place this command line task into the first step, then it could clean the Yarn cache firstly.
Also, because of the image configuration that the hosted agent is using, its installed node.js version is 6.7.0, this does not match the runtime environment for AppCenter cli. You need also run Node.js tool installer task to install node.js v10.0.0.
All of them should look like this:
Should it be both in the ios and android directory?
As I mentioned previously, for Hosted agent, each build will use a completely new VM. So yes, you must execute these two steps firstly in every build.
If what you used is your private agent, since you have installed the AppCenter cli locally, the agent will automatically call the local configuration when running the command line task. At this time, you just need to skip the install command in the command task:
We fixed it by adding a "yarn cache clean" in appcenter-post-clone.sh, you can add this shell script in root of project.
See this docs for details.

Nuxt deployment error: server resources are not available

To deploy our nuxt website in ssr mode we first build and unit test website in the bitbucket pipeline and if tests are green we copy build files from bitbucket servers to our production server and trigger start.
The problem is that Nuxt documentation says nothing about which exact files are required on the server.
currently we are using:
.nuxt/
server/
static/
nuxt.config.js
Sometimes after adding functionality to the website, deployed version throws an error:
Error: Server resources are not available!
At the same time local version works fine.
Also running production server locally on the project works.
Error kinda hints that some paths picked up incorrectly by nuxt.. but the directory structure is completely the same.
Any ideas why this happens and how to fix that?
If errors also mentions, Please check "file path"/.nuxt/dist/server existence.
Then on the terminal
cd .nuxt
check if 'dist' folder exists. If it does not exists,
go back and npm run build. this will generate the 'dist' folder for use.
If Still facing the issue, try,
npm install --save nuxt
npm install --save vue-server-renderer
Try adding: dev: process.env.NODE_ENV === 'DEV' to nuxt.config.js

Nativescript vue, how to get the .apk file?

By following nativescript docs, installed all dependencies and tns doctor dont find any error.
and followed a tutorial and ran the following commands,
npm install -g #vue/cli #vue/cli-init
vue init nativescript-vue/vue-cli-template hello-vue
cd hello-vue
npm install
All sets fine and then i did my coding for an simple app then i ran below command:
npm run watch:android
This deploy the app in my connected android phone.
so my question is how can i get the apk file, so that i can send to another person?
Note: sidekick even not opening my folder. and when running tns build android shows No project found at or above 'C:\wamp64\www\newapp' and neither was a --path specified.
For building the apk for android, use the following command:
tns build android --release --key-store-path <path-to-your-keystore> --key-store-password <your-key-store-password> --key-store-alias <your-alias-name> --key-store-alias-password <your-alias-password>
Lots more info here : https://docs.nativescript.org/tooling/publishing/publishing-android-apps
If you want to get the debug apk using tns debug android --bundle, it will be located here :
<your project folder>/platforms/android/app/build/outputs/apk/debug/app-debug.apk
If you are having trouble running tns, install nativescript globally using:
npm i -g nativescript
And follow the simple prompts.
I'm not sure if this is what you're looking for (it sounds like you want a debug.apk instead of an output.apk), but you might want to look at the documentation for publishing an Android app.

Run a Vue.js project in server without " npm run dev " command?

After installing vue cli globally by running npm install -g vue-cli, I have installed all the modules in the project folder "myBlog" by running npm install and can run the project in my local environment by using npm run dev. But when I am going to move this project in the live server is this is the right way to run the batch program (npm run dev) continuously or there are other ways to run the project without running npm run dev continuously?
It's not Vue specific but you also should be able to run npm run build which generates production bundles in /dist subfolder of your project. You are supposed to copy this folder to the production server and configure the server so that it serves dist/index.html for every URL.
If you are using the "webpack", "webpack-simple" or "pwa" template there is a dedicated command for creating the production build, which allows a static hosting (with no need to run any npm process in the server):
npm run build
It will create a dist folder which content you can upload to the root of your server.
Some more info about:
"webpack" template:
https://vuejs-templates.github.io/webpack/commands.html#npm-run-build
"webpack-simple":
https://github.com/vuejs-templates/webpack-simple#webpack-simple
"pwa": https://github.com/vuejs-templates/pwa#whats-included
Very simple. To launch a VueJs project, you must type "npm run serve".

Missing node_modules when deploying AngularJS2 application to Bluemix

We're trying to deploy an AngularJS2 application to bluemix but we're missing the folder "node_modules" after the application was deployed to the server. We're using npm to build the application.
I found the following post that is mentioning the problem: (https://developer.ibm.com/answers/questions/181207/npm-install-within-subdirectory-not-creating-node.html)
My question would now be: what's the recommended best practice?
I believe you are installing the node modules using npm install, you also should save those module in your package.json file which you can do that by npm install --save.
The recommended best practice would be to Setup a Build Pipeline.
There could be 3 stages or more:
Build Stage: It builds the app so doing things like npm install there so your folder node_modules gets created for you.
Test Stage: Tests the app so doing things like npm test would run all the tests in your app
Deploy Stage: Once build and deploy stage runs successfully, Deploy will actually deploy the app to the Bluemix domain.