'npm run serve' is not initiallizing project in browser - powershell

I am running 'npm run serve' command to execute my vue project in browser . But it is not giving any output or error it just keep running
enter image description here
it just stucks here only
I have tried every thing I have restarted my system and reinstalled vue-cli also but it it didn't worked.
I was running perfectly fine yesterday but today it's not working in fact it wasted my whole day
What did I try
Execute 'npm run serve' cmd
What I Expect
To open my project in Browser

npm run serve will run the built version of your project. It sound to me like you want to run it locally in the browser (for dev and testing) and should use npm run dev.
npm run serve will only serve the output of a npm run build command, and is usually only run after deploying to an actual server.

{
"name": "fer-07-project",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"lint": "eslint --fix --ext .js,.jsx .",
"init-project": "npm install && npm-run-all init:*",
"init:dirs": "mkdirp dist src/sass src/css src/vendor src/images src/js",
"init:files": "touch README.md src/index.html src/sass/style.scss src/js/script.js",
"init:gitignore": "curl https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore -o .gitignore",
"init:gitignore:custom": "echo \"dist\" >> .gitignore",
"test": "npm-run-all test:*",
"test:html": "globstar nu-html-checker dist/*.html",
"test:js": "eslint src/js/ --fix",
"test:scss": "stylelint src/sass/",
"build": "npm-run-all build:* test",
"build:clean": "mkdirp dist && rm -r dist && mkdirp dist",
"build:copy": "copyfiles -a -u 1 -e \"**/sass/**/*\" -e \"**/.gitkeep\" \"src/**/*\" dist",
"build:sass": "node-sass --output-style compact -o dist/css src/sass",
"build:autoprefixer": "globstar autoprefixer-cli \"dist/css/*.css\"",
"build-dev": "npm-run-all build-dev:sass build:autoprefixer",
"build-dev:sass": "node-sass --output-style expanded --source-map true -o dist/css src/sass",
"server": "json-server --port 3131 --no-cors --delay 250 --watch dist/db/app.json",
"watch": "npm-run-all build build-dev -p watch:* server",
"watch:browsersync": "browser-sync start --server dist --files \"dist/**/*\" --ignore \"dist/db/**/*\"",
"watch:sassprefixer": "onchange \"src/sass/**/*.scss\" -- npm run build-dev",
"watch:copy": "onchange -e \"**/sass/**/*\" -e \"**/.gitkeep\" \"src/**/*\" -- copyfiles -a -u 1 {{changed}} dist"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"flatpickr": "^4.6.9",
"json-server": "^0.16.3",
"rangeslider-pure": "^0.4.11"
},
"devDependencies": {
"autoprefixer-cli": "^1.0.0",
"browser-sync": "^2.26.3",
"copyfiles": "^2.1.0",
"eslint": "^5.14.1",
"globstar": "^1.0.0",
"mkdirp": "^0.5.1",
"node-sass": "^4.11.0",
"npm-run-all": "^4.1.5",
"nu-html-checker": "^0.1.0",
"onchange": "^5.2.0",
"stylelint": "^9.10.1",
"stylelint-scss": "^3.5.4"
}
}

Related

Which scripts can I run from the following piece of package.json file without breaking anything?

I apologize in advance if my question is inappropriate. I want to contribute to Open Source projects in the future. I've cloned one repo (MUI) and It feels like I'm not ready to contribute for now even though I know what package.json is and what it does. However in this case the scripts section is pretty clunky and I'm a bit afraid of trying one of these scripts. Is there a way to run something like "npm start" in create-react-app so I could explore the project? I would really appreciate your help.
"scripts":
{
"proptypes": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./scripts/generateProptypes.ts",
"deduplicate": "node scripts/deduplicate.js",
"benchmark:browser": "yarn workspace benchmark browser",
"build:codesandbox": "lerna run --parallel --scope \"#mui/*\" build",
"release:version": "lerna version --no-changelog --no-push --no-git-tag-version --force-publish=#mui/core-downloads-tracker",
"release:build": "lerna run --parallel --scope \"#mui/*\" build",
"release:changelog": "node scripts/releaseChangelog",
"release:publish": "lerna publish from-package --dist-tag latest --contents build",
"release:publish:dry-run": "lerna publish from-package --dist-tag latest --contents build --registry=\"http://localhost:4873/\"",
"release:tag": "node scripts/releaseTag",
"docs:api": "rimraf ./docs/pages/**/api-docs ./docs/pages/**/api && yarn docs:api:build",
"docs:api:build": "cross-env BABEL_ENV=development __NEXT_EXPORT_TRAILING_SLASH=true babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/buildApi.ts",
"docs:build": "yarn workspace docs build",
"docs:build-sw": "yarn workspace docs build-sw",
"docs:build-color-preview": "babel-node scripts/buildColorTypes",
"docs:deploy": "yarn workspace docs deploy",
"docs:dev": "yarn workspace docs dev",
"docs:export": "yarn workspace docs export",
"docs:icons": "yarn workspace docs icons",
"docs:size-why": "cross-env DOCS_STATS_ENABLED=true yarn docs:build",
"docs:start": "yarn workspace docs start",
"docs:i18n": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/i18n.js",
"docs:typescript": "yarn docs:typescript:formatted --watch",
"docs:typescript:check": "yarn workspace docs typescript",
"docs:typescript:formatted": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/formattedTSDemos",
"docs:mdicons:synonyms": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/updateIconSynonyms && yarn prettier",
"extract-error-codes": "cross-env MUI_EXTRACT_ERROR_CODES=true lerna run --parallel build:modern",
"template:screenshot": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/generateTemplateScreenshots",
"install:codesandbox": "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install --ignore-engines",
"jsonlint": "node ./scripts/jsonlint.js",
"lint": "eslint . --cache --report-unused-disable-directives --ext .js,.ts,.tsx --max-warnings 0",
"lint:ci": "eslint . --report-unused-disable-directives --ext .js,.ts,.tsx --max-warnings 0",
"stylelint": "stylelint --reportInvalidScopeDisables --reportNeedlessDisables docs/**/*.{js,ts,tsx}",
"markdownlint": "markdownlint \"**/*.md\" --config .markdownlint.jsonc",
"prettier": "node ./scripts/prettier.js",
"prettier:all": "node ./scripts/prettier.js write",
"size:snapshot": "node --max-old-space-size=4096 ./scripts/sizeSnapshot/create",
"size:why": "yarn size:snapshot --analyze",
"start": "yarn && yarn docs:dev",
"t": "node test/cli.js",
"test": "yarn lint && yarn typescript && yarn test:coverage",
"test:coverage": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=text mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' 'scripts/**/*.test.{js,ts,tsx}' 'test/utils/**/*.test.{js,ts,tsx}'",
"test:coverage:ci": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' 'scripts/**/*.test.{js,ts,tsx}' 'test/utils/**/*.test.{js,ts,tsx}'",
"test:coverage:html": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=html mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' 'scripts/**/*.test.{js,ts,tsx}' 'test/utils/**/*.test.{js,ts,tsx}'",
"test:e2e": "cross-env NODE_ENV=production yarn test:e2e:build && concurrently --success first --kill-others \"yarn test:e2e:run\" \"yarn test:e2e:server\"",
"test:e2e:build": "webpack --config test/e2e/webpack.config.js",
"test:e2e:dev": "concurrently \"yarn test:e2e:build --watch\" \"yarn test:e2e:server\"",
"test:e2e:run": "mocha --config test/e2e/.mocharc.js 'test/e2e/**/*.test.{js,ts,tsx}'",
"test:e2e:server": "serve test/e2e",
"test:e2e-website": "playwright test test/e2e-website --config test/e2e-website/playwright.config.ts",
"test:e2e-website:dev": "cross-env PLAYWRIGHT_TEST_BASE_URL=http://localhost:3000 playwright test test/e2e-website --config test/e2e-website/playwright.config.ts",
"test:karma": "cross-env NODE_ENV=test karma start test/karma.conf.js",
"test:karma:profile": "cross-env NODE_ENV=test karma start test/karma.conf.profile.js",
"test:regressions": "cross-env NODE_ENV=production yarn test:regressions:build && concurrently --success first --kill-others \"yarn test:regressions:run\" \"yarn test:regressions:server\"",
"test:regressions:build": "webpack --config test/regressions/webpack.config.js",
"test:regressions:dev": "concurrently \"yarn test:regressions:build --watch\" \"yarn test:regressions:server\"",
"test:regressions:run": "mocha --config test/regressions/.mocharc.js --delay 'test/regressions/**/*.test.js'",
"test:regressions:server": "serve test/regressions",
"test:umd": "node packages/mui-material/test/umd/run.js",
"test:unit": "cross-env NODE_ENV=test mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' 'scripts/**/*.test.{js,ts,tsx}' 'test/utils/**/*.test.{js,ts,tsx}'",
"test:argos": "node ./scripts/pushArgos.js",
"typescript": "lerna run --no-bail --parallel typescript",
"typescript:ci": "lerna run --concurrency 7 --no-bail --no-sort typescript",
"validate-declarations": "babel-node --extensions \".ts\" scripts/validateTypescriptDeclarations.ts",
"generate-codeowners": "node scripts/generateCodeowners.mjs"
},
There is start command
"start": "yarn && yarn docs:dev"
You should be able to run yarn start in your console.
On the topic "what if you break something", well its cloned local copy, so what... just delete it and clone it again if you need to.

How can I deploy to gh-pages using json-server and parcel command?

I want to distribute what I have studied.
In local , open a screen by typing the following in a terminal:
"parcel index.html",
"json-server --watch products.json --port 8080",
"json-server users.json -m ./node_modules/json-server-auth"
How can I deploy and host this on gh-pages?

Unable to install ansible-awx Ubuntu 18.04

I am trying to install AWX on Ubuntu 18.04 and i am getting the Error.
I have checked out the latest version of awx from github and tried running the install using
ansible-playbook -i inventory install.yml -vvvv
TASK [local_docker : Start the containers] ************************************************************************************************************************************************************************
task path: /temp/awx/installer/roles/local_docker/tasks/compose.yml:25
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/cloud/docker/docker_service.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: sateesh
<localhost> EXEC /bin/sh -c 'echo ~sateesh && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173 `" && echo ansible-tmp-1555964996.64-166348838404173="` echo /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173 `" ) && sleep 0'
<localhost> PUT /home/sateesh/.ansible/tmp/ansible-local-18120SkKEmm/tmpaVUC61 TO /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173/docker_service.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173/ /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173/docker_service.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/env python /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173/docker_service.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/sateesh/.ansible/tmp/ansible-tmp-1555964996.64-166348838404173/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
File "/tmp/ansible_oWaqla/ansible_module_docker_service.py", line 745, in cmd_up
timeout=self.timeout)
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 559, in up
'Encountered errors while bringing up the project.'
fatal: [localhost]: FAILED! => {
"changed": false,
"errors": [],
"invocation": {
"module_args": {
"api_version": null,
"build": false,
"cacert_path": null,
"cert_path": null,
"debug": false,
"definition": null,
"dependencies": true,
"docker_host": null,
"files": null,
"filter_logger": false,
"hostname_check": false,
"key_path": null,
"nocache": false,
"project_name": null,
"project_src": "/tmp/awxcompose",
"pull": false,
"recreate": "smart",
"remove_images": null,
"remove_orphans": false,
"remove_volumes": false,
"restarted": false,
"scale": null,
"services": null,
"ssl_version": null,
"state": "present",
"stopped": false,
"timeout": 10,
"tls": null,
"tls_hostname": null,
"tls_verify": null
}
},
"module_stderr": "Creating awx_web ... \r\n\r\u001b[1B",
"module_stdout": "",
"msg": "Error starting project unknown cause"
}
to retry, use: --limit #/temp/awx/installer/install.retry
PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost : ok=8 changed=0 unreachable=0 failed=1
Not sure why it is failing.
I have the following versions of Ansible , pip & Docker
ansible 2.5.4
python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]
Docker version 18.03.1-ce, build 9ee9f40
pip 19.0.3
Thanks
Sateesh
I've tried your solution and ran into the same issue.
My problem was that my host was running apache2, so the port 80 was already taken. After stopping and removing apache2, the build went through.
Thanks.
I've been following this question from the start as I did encounter the exact same message you did. I didn't have a possible solution to your question until now.
I just managed to install the latest version of AWX on my Ubuntu server running 18.04. What I've done to solve my issue (and I've tried this many times before) was:
Getting the latest AWX version from github
Edit the inventory file located in awx/installer keeping the path to postgres_data_dir the same as before
Use a command to kill all my running docker conatiners:
docker container kill | docker container ls $(awk '{print $1}')
Note!: I don't have any containers running except those used for AWX
Removing all containers on my system:
docker container rm <container>
Note!: Again, I don't have any containers except those used for AWX
I've used the TAB key to let bash suggest the container names
Used the ansible playbook for AWX:
ansible-playbook -i inventory install.yml
And thats it! This time I upgraded to the latest version of AWX. In my case, I wanted to update to the latest version. I don't know if you were updating or installing it "for the first time". But this is how I managed to do it, so maybe it works for you as well.
Good luck solving your issue if you haven't already.
P.S. Make sure project_src is not /tmp/awxcompose. This wil cause some issues I learned. It'll work, but if you reboot Ubuntu, AWX will run into a problem: See this link

golang dlv unable to see source:: no such file or directory

In a docker container:
docker run \
--rm -it \
-p 80:80 \
-p 2345:2345 \
-v $(pwd)/src:/go/src/ \
--security-opt="seccomp=unconfined" \
--privileged \
--cap-add SYS_PTRACE \
golang bash
In the container at $GOPATH:
go get -u github.com/derekparker/delve/cmd/dlv
dlv version
Delve Debugger
Version: 1.1.0
Build: $Id: 1990ba12450cab9425a2ae62e6ab988725023d5c
dlv debug app --headless --listen=0.0.0.0:2345 --api-version=2
In mac terminal at $GOPATH::
dlv version
Delve Debugger
Version: 1.1.0
Build: $Id: 1990ba12450cab9425a2ae62e6ab988725023d5c $
dlv connect 127.0.0.1:2345
I get the following, but unable to list source?
dlv connect 127.0.0.1:2345
Type 'help' for list of commands.
(dlv) b main.go:29
Breakpoint 1 set at 0x7f584d for main.main.func1() /go/src/app/main.go:29
(dlv) c
> main.main.func1() /go/src/app/main.go:29 (hits goroutine(4):1 total:1) (PC: 0x7f584d)
(dlv) l
> main.main.func1() /go/src/app/main.go:29 (hits goroutine(4):1 total:1) (PC: 0x7f584d)
Command failed: open /go/src/app/main.go: no such file or directory
Note: I am in $GOPATH in both the dlv server and client:
In container:
ls $GOPATH/src/app
layout.html main.go mypack
In mac terminal:
ls $GOPATH/src/app
layout.html main.go mypack
vs code launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Connect to server",
"type": "go",
"request": "launch",
"mode": "remote",
"remotePath": "${workspaceFolder}",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceFolder}",
"env": {},
"args": [],
"trace": "verbose"
},
]
}
See https://github.com/go-delve/delve/issues/1438. Solution is to put this in
$HOME/.dlv/config.yml:
substitute-path:
- {from: /, to: /root}
On my Ubuntu 18.04 I see the location of the file as ~/.config/dlv/config.yml. Here is an example:
substitute-path:
- {from: /code, to: /home/foo/git/repo}
I wanted to add to the answers above that you do not necessarily need to create a config.yaml file to set substitute-path, you can also do so from inside dlv shell by running: config substitute-path / /root

Installing docker-compose using coreos ignition

I know how to install using cloud-config. But since this is a first-boot only task, I would instead like to install it using ignition.
Here is my attempted configuration (that doesn't work):
"systemd": {
"units": [{
"name": "install-docker-compose.service",
"contents": "[Unit]\nDescription=Install docker-compose\nConditionPathExists=!/opt/bin/docker-compose\n[Service]\nType=oneshot\nRemainAfterExit=yes\nExecStart=/usr/bin/mkdir -p /opt/bin/\nExecStart=/usr/bin/curl --create-dirs -o /opt/bin/docker-compose -sL \"https://github.com/docker/compose/releases/download/1.9.0/docker-compose-linux-x86_64\"\nExecStart=/usr/bin/chmod +x /opt/bin/docker-compose"
}]
}