Unable to create IONIC project - javascript

I am getting following error while creating new project whith ionicFramework, any one have idea how to resolve it.
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:256
if<res.statusCode !==200> {
TypeError: Cannot read property 'statusCode' of undefined
atRequest._callback(C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:256
ic\lib\ionic.js:257:13)
at self.callback (C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:256
ic\lib\ionic.js:129:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (C:\Users\...\AppData\Roaming\
npm\node_modules\ionic\node_modules\request\request.js:239:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at SocketPair.<anonymous>(tls.js:1384:19)
at SocketPair.emit (events.js:92:17)
at SocketPair.maybeInitFinished(tls.js:977:10)

Update your version of the ionic CLI tool first. Alternatively you could manually start the app.
Download the base app and unzip into your directory. https://github.com/driftyco/ionic-app-base
Download the blank template and merge files into the same directory. https://github.com/driftyco/ionic-starter-blank
Run bower install to make sure bower assets are up to date
Run npm install to install assets for gulp to build sass (optional if you don't use sass)
Thats just what the ionic start command does in a nutshell.

Check if you have 'tutorial' in your Ionic Starter templates :
ionic start --list
If It's not in the list, you must add it to the list by Updating your Ionic Framework:
Update Ionic CLI : sudo npm install -g ionic
Update Ionic Library : ionic lib update
Update Apache Cordova : sudo npm install -g cordova

Related

How to integrate storybook into react-native package 'create-react-native-library'

Hi i want to run storybook in a react-native package, that i have created with create-react-native-library.
So, the steps i ve done, in order to havethe package up and running are:
from the react-native documentation : https://reactnative.dev/docs/native-modules-setup
Run npx create-react-native-library#latest react-native-awesome-module // create a simple package
in the examplesfolder, run yarn start so it loads on the iPhone simulator.
Because it is a package and not an application, i want to have storybook inside it, so to visualize the components.
Install storybook like so: npx -p #storybook/cli sb init --type react
The yarn storybook command gives error like so: Error: Cannot find module 'react-dom/package.json'
I attach a screenshot for reference:
So, is there a way to integrate the storybook into this package ? Do i miss anything ? thanks
According to the Storybook for React Native | Documentation,
You have to specify the --type as react_native not react.
npx -p #storybook/cli sb init --type react_native
To use storybook with react native you have to change --type to react_native.
This means, that your command to initialize storybook will be:
npx -p #storybook/cli sb init --type react_native

AdonisJS doesn't start after installing another npm package

I'm developing an AdonisJS API, everything was going well until I install vimeo npm package, after this I cannot set server up appearing this error:
$ adonis serve --dev
SERVER STARTED
> Watching files for changes...
Error: Cannot find module '#adonisjs/framework/providers/AppProvider'
1 requireStack
/mnt/c/Users/felip/Desktop/API/2019-2_DevWeb01/API/node_modules/require-stack/src/index.js:44
2 _.uniq.map
/mnt/c/Users/felip/Desktop/API/2019-2_DevWeb01/API/node_modules/#adonisjs/fold/src/Registrar/index.js:104
3 arrayMap
/mnt/c/Users/felip/Desktop/API/2019-2_DevWeb01/API/node_modules/lodash/lodash.js:639
4 Function.map
/mnt/c/Users/felip/Desktop/API/2019-2_DevWeb01/API/node_modules/lodash/lodash.js:9554
5 interceptor
/mnt/c/Users/felip/Desktop/API/2019-2_DevWeb01/API/node_modules/lodash/lodash.js:16997
6 thru
/mnt/c/Users/felip/Desktop/API/2019-2_DevWeb01/API/node_modules/lodash/lodash.js:8795
I'm using WSL and node 8.9.3, also tried in node 10.17.0.
Also tried to install manually '#adonisjs/framework' and Reinstall all packages, deleting node_modules, but didn't work.
can you install adonisjs package globally.
if not then install using this command.
npm i -g #adonisjs/cli
if any other query then ask
Make sure your project has a .env file
or run cp .env.example .env

React and Bootstrap4 issue when creating application using create-react-app

I am using Windows 10. Follwoing are the two scenarios where I faced problems. I created applications using create-react-app command. I installed create-react-app using command npm i -g create-react-app#1.5.2
Scenario 1
I stopped react server which was running using npm start command. Then I installed bootstrap using npm i bootstarp#4.1.1 and then I tried to run command npm start but rathern than starting the server, it has given an error 'react-scripts' is not recognized as an internal or external command.
The application is working perfactly before I stopped the react server and installed bootstrap.
Steps to recreate the problem:
create-react-app demo
cd demo
npm start (loaded the application in browser with home page)
stopped the server using Ctrl + C (break)
npm i bootstrap#4.1.1
npm start (giving error 'react-scripts' is not recognized as an internal or external command)
Scenario 2
I installed bootstrap in running react server using another command window / visul studio command line using npm i bootstarp#4.1.1 and when I imported bootstrap file in index.js and saved the file. It have given error
./node_modules/style-loader/lib/addStyles.js
Module build failed: Error: ENOENT: no such file or directory, open 'D:\react\demo2\node_modules\style-loader\lib\addStyles.js'
Steps to recreate the problem:
create-react-app demo
cd demo2
npm start (loaded the application in browser with home page)
Open another command window and reached to location demo4 folder
npm i bootstrap#4.1.1
open index.js in src folder and write: import 'bootstrap/dist/css/bootstrap.css';
save the file and error comes.
I've found many topics about this issue:
https://github.com/facebook/create-react-app/issues/1627
https://github.com/facebook/create-react-app/issues/2436
'react-scripts' is not recognized as an internal or external command
I think that it is related to the npm version that you use. It seems that npm doesn't install all the required dependencies.
Try to run npm update in order to update the dependencies. After this, npm start should work fine:
npm update
npm start

react-native not found + mac os

I am trying to run basic react-native app in my macOS. I installed node through brew .
My node version: v6.12.0
npm version :5.5.1
Then i installed reatc-native-cli using npm. Now when i try to create a project using react-native init it says react-native command not found.
I tried all solutions but no hope. as i am new bee to this react-native guide me solve this. Thanks in advance.
I tried all post including
react-native: command not found
You should install React-Native CLI first before using "react-native init".
npm install -g react-native-cli
For more information of getting started React-Native in manual, please follow this Document
https://facebook.github.io/react-native/docs/getting-started.html
And select tab Building Projects with Native Code for manual create project without Expo
Steps to install React Native CLI in Mac OS:
Run npm install -g react-native-cli
or sudo npm install -g react-native-cli
2. Once successful, get the installed path from the output:
/Users/jeemok/.npm-packages/bin/react-native -> /Users/jeemok/.npm-packages/lib/node_modules/react-native-cli/index.js
+ react-native-cli#2.0.1
added 78 packages from 28 contributors in 12.39s
In my case, my path is /Users/jeemok/.npm-packages/bin/react-native
3. Run export PATH="/Users/jeemok/.npm-packages/bin:$PATH"
4. Now you should be able to use the command react-native
Example to init a project
react-native init TodoApp
cd TodoApp
react-native run-ios
1.install
-Xcode
-Android Studio
2.
react-native init FirstApp
if hit the below error
-bash:react-native:command not found
4.
npm list -g | head -n 1
5.
/usr/local/Cellar/node/8.1.4/lib
U will found the file "react native"
6.
open .bash_profile (if .bash_profile not exist setup .bash_profile)
add the below in .bash_profile file
export PATH=”/usr/local/Cellar/node/8.1.4/bin:$PATH”
run the command to reload .bash_profile
source .bash_profile
8.create your project
react-native init FirstApp
How I solved this issue.
Call npm list -g | head -n 1
Open .bash_profile in a code editor. It should be located at ~/.bash_profile
Paste export PATH="/usr/local/Cellar/node/10.12.0/bin:${PATH}" somewhere in it. Make sure you have the correct version in there. Also make sure PATH is wrapped in { }
Save the file.
Close your terminal and reopen. You should be good now.
How I solved this not found issue. For those who are still facing the issue, I am sharing my solution.
I have setup a fresh react native project by running the following command.
npx react-native init AwesomeProject
we don't need to install
react-native-cli
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues.
as mentioned in the original docs.
just add npx at beginning npx react native link and it worked!

angular-cli ng serve errors

angular-cli used to work perfectly, but now I don't know why when creating a new project it doesn't run the server.
I tried reinstalling angular-cli.
I create a new app with ng new app.
I navigate into the /app/ path, run ng serve and I get:
No errors
Error: No errors
at validate (C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\extract-text-webpack-plugin\schema\validator.js:10:9)
at Function.ExtractTextPlugin.extract (C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\extract-text-webpack-plugin\index.js:188:3)
at C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\angular-cli\models\webpack-build-styles.js:79:83
at Array.map (native)
at Object.getWebpackStylesConfig (C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\angular-cli\models\webpack-build-styles.js:76:43)
at new NgCliWebpackConfig (C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\angular-cli\models\webpack-config.js:44:51)
at Class.run (C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\angular-cli\tasks\serve-webpack.js:23:22)
at C:\Users\Gasti\Documents\Prgm\githubsearch\node_modules\angular-cli\commands\serve.run.js:37:22
at process._tickCallback (internal/process/next_tick.js:103:7)
From an Angular CLI developer:
This problem arises from a recent update in a external dependency and it's not fixable without a CLI release right now.
He also confirmed that the workaround is to install the dependency at version 2.0.0-rc.0:
npm install extract-text-webpack-plugin#2.0.0-rc.0 --save-dev

Categories

Resources