The page is not refreshed when App.js saved.
Compiled successfully!
You can now view my-app in the browser.
Local: http://localhost:3000
On Your Network: http://172.17.206.116:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
node -v v14.17.0
npm -v 6.14.13
windows 10
Related
Tried every possible step
Reinstalled Node, NPM, Expo, etc.
Cleaned Cache, verified it aswell.
Please help or I would have to reinstall Ubuntu.
faisal#PC:~$ expo init
Migrate to using:
› npx create-expo-app --template
✔ What would you like to name your app? … my-app
✔ Choose a template: › blank a minimal app as clean as an empty canvas
Error downloading and extracting template package: TypeError: Cannot read properties of null (reading '0')
✖ Something went wrong while downloading and extracting the template.
Can't read JSON file: /home/faisal/my-app/app.json
└─ Cause: Error: ENOENT: no such file or directory, open '/home/faisal/my-app/app.json'
├─ readAsync /usr/local/lib/node_modules/expo-cli/node_modules/#expo/json-file/src/JsonFile.ts:158:13
├─ extractAndPrepareTemplateAppAsync /usr/local/lib/node_modules/expo-cli/src/commands/utils/extractTemplateAppAsync.ts:25:25
└─ actionAsync /usr/local/lib/node_modules/expo-cli/src/commands/initAsync.ts:290:19
faisal#PC:~$ npx create-expo-app myapp
✖ Something went wrong in downloading and extracting the project files: Could not find npm package "expo-template-blank#latest"
Error cloning template: Error: Could not find npm package "expo-template-blank#latest"
faisal#PC:~$ npm ls -g
/usr/local/lib
+-- #angular/cli#14.2.3
+-- expo-cli#6.0.5
+-- expo-template-blank#46.0.21
`-- npm#8.19.2
faisal#PC:~$ npm -v
8.19.2
Reinstalled Node using NVM
Apparently the node I installed multiple times through the store was giving the error so I decided to use the Node Version Manager instead.
Instructions:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm list-remote
nvm install v16.17.1
And yes, it works:
faisal#pc:~$ nvm install v16.17.1
Downloading and installing node v16.17.1...
Downloading https://nodejs.org/dist/v16.17.1/node-v16.17.1-linux-x64.tar.xz...
######################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.17.1 (npm v8.15.0)
Creating default alias: default -> v16.17.1
faisal#pc:~$ expo init
Migrate to using:
› npx create-expo-app --template
✔ What would you like to name your app? … my-app
✔ Choose a template: › blank a minimal app as clean as an empty canvas
✔ Downloaded template.
📦 Using npm to install packages.
✔ Installed JavaScript dependencies.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd my-app
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues:
Run this command
npm uninstall -g react-native-cli #react-native-community/cli
Start a new project
npx react-native init AwesomeProject
I created a new folder in Windows 10 and opened it in Visual Studio Code. After creating 'index.html' at the root, I ran the following commands:
npm init
npm install --save-dev lite-server
I added the following, under scripts, in package.json:
"start": "lite-server"
After that, when I ran 'npm start' it opened a new tab in my browser (http://localhost:3000) but my 'index.html' is not loaded (instead I saw 'no internet'). No other process was running on port 3000.
Could you help me load 'index.html' by running 'npm start' please?
First try this line instead of your second line. It is not in the same order which it should be according to this, https://github.com/johnpapa/lite-server
npm install lite-server --save-dev
Same happened to me in MacOS. I did this and it worked. So if the above does not work, run as administrator in windows 10 and try!
rm -rf node_modules/
sudo npm install
I initialized a vue project by vue/cli, and i do not change any code.After init completion, i run the command to start a development server by npm run dev.And the output show the the server running on localhost:8080, but i can not access it neither by localhost:8080 nor 127.0.0.1:8080.
I haved tried to uninstall safety software, choose vue/cli#2, check hosts file.
C:\Users\Administrator\Desktop\cl>node -v
v10.16.3
C:\Users\Administrator\Desktop\cl>npm -v
6.9.0
"webpack-dev-server": {
"version": "2.11.5",
Try npm run serve. You are not telling vue-cli-service to start a server, only to build locally.
I git cloned vue, cd'ed into one of the examples folder and ran npm install. Everything went fine, then I ran npm run dev and it gets stuck at this stage. Is there anything else I should do to run this locally?
npm run dev
> vue#2.4.2 dev /vue
> rollup -w -c build/config.js --environment TARGET:web-full-dev
bundling...
bundled in 2456ms. Watching for changes...
You need to run a local web server.
Try this:
Install http-server package with npm:
$ sudo npm install -g http-server
Run it in the root of the vue cloned folder:
$ git clone git#github.com:vuejs/vue.git
$ cd vue
$ http-server -o -c .
In yout browser, navigate to the examples folder, for instance:
http://127.0.0.1:8081/examples/select2/
They are the same from here:
https://v2.vuejs.org/v2/examples/
Getting a bunch of babel errors when running npm run dev with the Vue cli.
This only happens in Cloud9.
Any thoughts on what could be the issue or how to disable errors like this before running npm run dev?
All babel related it looks like.
I couldn't re-create the babel error messages but it's possible that it could be caused if npm/node is not up-to-date. (Vue-cli wasn't starting dev server before the installation below)
Is your repository public where you're getting the error messages? Then I could have a look at the errors.
If removing node_modules folder is not helping,
here is how you can create a new IDE workspace for vue.js ($ for commands in bash terminal):
Create a blank Ubuntu workspace
Check that nvm is installed & up-to-date with (check version of install script here):
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
$ nvm install node 6
$ npm i vue-cli -g
$ vue init webpack yourAppName
$ cd yourAppName
$ npm install
$ npm run dev
Click preview to test that Vue server is running as expected
Here is a link to a HelloWorld Vue app in cloud9 ide.
If you have an existing app you can also use git to clone it into your new workspace instead of creating a new app.