so i am trying to run sass with yarn start at the same time.
when i run yarn build:sass in command line , it triggesr the sass watch and if I make any changes into the sass it will update the css file however it wont start the project "yarn start doesnt work" is there anyway for me to run it all in one console?
"build:sass": "node-sass src dist",
"watch:css": "yarn build:sass && yarn build:sass -- -w && yarn start",
"start": "PUBLIC_URL=/ react-scripts start",
for anyone out there u can run this using run all
install the package first and then have it run after
start": "npm-run-all -p watch:sass start:react"
Related
Our team decides to use yarn berry on our project, and one in my team initialize project. So I cloned the project on my local and run "yarn start" in terminal But it is not work.
This is the Error message.
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
I tried "yarn install" and it worked but node_modules and other things are generated.
You likely have to first do the command:
yarn install
Then
yarn start
I'm trying to use yarn dev to run the guest-book example following the guest-book example, but this is what I got:
Computer#Summerbook MINGW64 ~/Documents/VS Code Projects/near apps/guest-book (master)
$ yarn dev
yarn run v1.22.11
$ yarn build:contract:debug && near dev-deploy && nodemon --watch assembly -e ts --exec yarn dev:start
$ asb --target debug
'asb' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I think the error is this:
'asb' is not recognized as an internal or external command,
operable program or batch file.
The script in package.json is:
"scripts": {
"build": "yarn build:contract && yarn build:web",
"build:contract": "asb",
"build:contract:debug": "asb --target debug",
"build:web": "parcel build src/index.html --public-url ./",
"deploy": "yarn build && near deploy && gh-pages -d dist/",
"dev": "yarn build:contract:debug && near dev-deploy && nodemon --watch assembly -e ts --exec yarn dev:start",
"lint": "eslint \"./**/*.js\" \"./**/*.jsx\"",
"start": "yarn deploy && parcel src/index.html",
"dev:start": "env-cmd -f ./neardev/dev-account.env parcel src/index.html",
"test": "yarn build:contract:debug && asp && jest"
I've tried installing dependencies again, but it didn't work.
I believe I'm running under the same directory as package.json.
What can I do here? What causes the error with 'asb'? Thanks for any help!
Moving my answer from the comment:
yarn and then yarn dev should just work. Try using regular Windows terminal (cmd or powershell).
Your VS code seems to use mingw (bash for Windows) environment, which brings its own set of quirks. You may want to switch your default terminal in VS code back to cmd or powershell.
Please try sudo npm install -g asbuild.
Feel free to +1 on https://github.com/near-examples/guest-book/issues/543
It seems that the update to the sdk was never merged with the example. I updated it here: https://github.com/near-examples/guest-book/pull/539#pullrequestreview-721177317
Please try again and let me know if the issue is fixed. Thanks!
I am new to app development so I'm sure this is an easy question for you seasoned pros out there.
I have a simple MERN stack app running in development using concurrently to run both the front-end and back-end. Before I deploy my app to Heroku I wanted to validate that it will run with the Heroku command line "Heroku local web". This successfully starts my server and connects my database but it does not start the front end at all. I think this may be something wrong with my package.json scripts but I have tried everything. My scripts are as follows:
"scripts": {
"install-client": "cd client && npm install",
"start": "node server.js",
"build": "cd client && npm run build",
"client": "cd client && npm start",
"dev": "concurrently -n 'server,client' -c 'red,green' \"nodemon server.js\" \"npm run client\"",
"heroku-postbuild": "npm run install-client && npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
I suppose you run your app on your local machine with npm run dev but according to heroku's documentation here they start your app with npm start unless specified otherwise by a file named Procfile in your app’s root directory.
The start script in your package.json file indeed runs only the server (node server.js).
Try copying the content of the dev script to the start script, or adding a file named Procfile with the single line:
web: npm run dev
or whatever command you use, in your app’s root directory.
Installed Adonis with yarn on Ubuntu 18 (running on WSL2 VM):
pomatti#NT-03024:~/Projects/myApp$ yarn global add #adonisjs/cli
yarn global v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.9: The platform "linux" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "#adonisjs/cli#4.0.12" with binaries:
- adonis
Done in 3.29s.
However when I try to run it, the command is not found:
pomatti#NT-03024:~/Projects/myApp$ adonis
adonis: command not found
What is odd is that my package.json commands are working properly and my app is started, but I am not able to call adonis directly in the command line (the global installation).
For example, yarn migration && adonis serve --dev --debug works.
"scripts": {
"serve": "adonis serve",
"migration": "adonis migration:run",
"start": "yarn migration && yarn serve",
"dev": "yarn migration && adonis serve --dev --debug",
"lint": "yarn eslint"
},
Try to install with NPM. Command:
> npm i -g #adonisjs/cli
Official documentation
For CLI tools installed with yarn global to work, you need to have the global yarn bin directory in your PATH. By default the yarn bin dir should be ~/.yarn/bin. To double check if that's right on your system and the adonis executable exists (assuming you've already run yarn global add #adonisjs/cli):
ls ~/.yarn/bin/adonis
(Mine is there).
To add that to my PATH:
cat > ~/.bashrc.d/yarn <<EOF
PATH="$HOME/.yarn/bin:\$PATH"
EOF
chmod +x ~/.bashrc.d/yarn
. ~/.bashrc.d/yarn
Then double check PATH: echo $PATH. Here's mine (after the above - your may not have all of these paths, but so long as it has /home/user/.yarn/bin - where user is your username):
/home/user/.yarn/bin:/home/user/bin:/home/user/.local/bin:/usr/lib/git-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I am using the following logic within my package.json file for a webpack project:
"scripts": {
"dev": "webpack --mode development",
"build": "webpack --mode production ",
"clean": "rm -r deploy",
"start": "npm run clean && npm run dev && webpack-dev-server --mode development"
},
If my deploy directory does not exist, and I run npm start, I get the following message in my terminal:
rm: cannot remove 'deploy': No such file or directory
Is there a way to check if the directory exist first? And if does, then just skip the clean process?
Its better to use clean-webpack-plugin
but here you can also use rm -rf deploy.