Trying to get started with a Docusaurus v2 website. Don't know much about npm or JavaScript in general, so maybe I'm missing something obvious.
I'm on Ubuntu 20.10, npm -v is 6.14.8, npx -vis 10.2.2 and yarn -v is 1.22.5.
When I execute the example from the documentation, I get an error:
$ npx #docusaurus/init init my-website classic
Too many arguments.
If I try without the name or template, I would expect it to prompt for them, but get another error:
$ npx #docusaurus/init init
Expected single character argument.
Is there something fundamentally wrong with my npm installation?
Thanks
Turns out, I just had to user a newer node version. Details about the issue are here.
A workaround would be to use #latest as in
npx #docusaurus/init#latest init my-website classic
Related
I installed expo-cli 5.4.10 (node v16.14.0) after which i execute the command
yarn start
I go to the browser and see this error in the console ReferenceError: process is not defined
looking for several solutions such as (https://bobbyhadz.com/blog/react-referenceerror-process-not-defined)
I have tried the following
npm install react-scripts#latest
npm install --save-dev react-error-overlay#6.0.9
package.json
"resolutions": {
"react-error-overlay": "6.0.9"
}
but this does not solve my problem in any way, perhaps someone has come across a similar one and is ready to help me
Had same problem today.
Solution: npm i -g expo-cli#5.4.9
The web interface from cli is broken in version 5.4.10.
You can either use it with the terminal only, or use 5.4.8 (5.4.9 might work, but I haven't tested it yet)
I just created a brand new React Native project, and I can't get it to run. The server always fails on the following:
node_modules/react-native/node_modules/#react-native-community/cli/build/commands/doctor/healthchecks/index.js:48
} catch {}
^
SyntaxError: Unexpected token {
The only thing I've found on this issue is this thread, which ends with people saying to post this question on Stackoverflow, hence why I'm here. I've tried the usual: upgrading node versions, removing node_modules and reinstalling, restarting my machine, all to no avail. I even delved into the code to see if I could figure out what's going on, but nothing jumped out at me.
My hope is that others have run into this with new React Native projects and that someone can help me resolve it. Any suggestions are welcome. Thanks!
Sigh.... Well after struggling with this for a day I found the workaround was to run npx react-native start in one console and then run npx react-native run-ios in another. I was just trying to do the latter by itself (which always worked in the past), and I guess that doesn't work anymore.
Probably your node and/or npm version is to old. Check by npm -v and node -v and update to latest version, or suggesting by react-native crew in dependencies from node site. Or if you use nvm try:
nvm install 16.14.0 && nvm alias default 16.14.0 && nvm use 16.14.0
Note that, this is for specific version. For latest, type:
nvm install --lts --latest-npm
nvm use x.x.x //latest installed version
This problem is due to node version. Upgrade your node verion above 12. It will solve the problem.
Use can either use nvm or directly install the node
if you are using android studio start it with command line
like this cd /path/to/android-studio/bin
then studio.sh make sure its executable
I’m getting that message after installing express globally.
I went through most of the solutions related to the /.bash_profile file and about exporting the correct PATH, but it still nothing works.
I tried this solution https://superuser.com/a/1081802 and it worked on the terminal, but when I close it and tried to execute the command express followed by the file I wanted to use, it ended up showing the same message.
Please help!
So I was looking for other kinds of solutions, and I remembered that I installed via the website and not by home-brew. Just in case, I uninstalled it and installed node again.
I run this:
npm install express -g
npm install express-generator -g
And up to this point it is now working.
I would really appreciate help with this.
I have cygwin installed and set up to use the PATH from windows. This has been working great for a ton of node development, but I've recently run into an issue where when I run
yarn jest --watch
I get the following error:
--watch is not supported without git/hg, please use --watchAll
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have installed git and node in windows.
I have found a workaround of using the Command Prompt for running the tests, but would really like to be in one environment.
--watch works only for git repositories.
if you still have issue it is yarn issue npm gives the same error too. delete your node_modules folder, update yarn or npm to the latest version, then reinstall all the packages again.
After some consideration, I thought my workaround could be a valid answer to this question. Although, I would still like to get this working properly in Cygwin.
If you have node and git installed in windows then you can go into the Command Prompt and run yarn test --watch or npm run test -- --watch to accomplish the same thing.
I know it's been a long time. But i was facing the same issue and what resolved it for me was, to change the default terminal of whatever editor you're using to GIT command line. I was using VS Code and changing the terminal to GIT worked like a charm.
Make sure you're running it in a Git repo (initialised with git init). Otherwise it doesn't know how to get only the changed files.
If you don't want to run tests only on changed files, you can use --watchAll, which runs all the tests.
I also encountered this problem, the reason is that I use the mv command to move the project folder, however the command was not removed .git has points such as the beginning of the file
npm run test -- watchAll
Please use watchAll to serve it in a continue way. It will track your changes and re-run the test automatically.
git init
solves the problem, that way it knows the changed files
After running following command i am getting error
npx create-react-app
"$basedir/../../Users/abc/AppData/Local/Yarn/.global/node_modules/.bin/create-react-app.cmd" "$#"
The system cannot find the path specified.
node and NPM versions
λ node -v
v9.5.0
λ npm -v
5.6.0
After searching and some digging, I finally found the solution. I installed yarn before, so it was mixing something up...
create-react-app command was still working when i completely removed it form my PC.
In short create-react-app.cmd file was reside in ProgramFils\nodjs folder I don't know why/how this file was there. After removing the creat-react-app command file all was set.
I had the same error message. I solved this by using yarn instead of npx:
yarn create react-app [name of app]
Note there is no hyphen between create and react-app