Im using two computers and want to sometimes develop on one computer and sometimes on another. But is it possible to develop the same react js app via two computers synching everything via dropbox so all the files stays in sync. Im getting this error when Im running npm start
sh: /Users/mycomputer/Dropbox/webb/myapp/node_modules/.bin/react-scripts: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! perottosson#0.1.0 start: `react-scripts start`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the perottosson#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
For using code in multiple computer, definitely you can use version control tool like Github/Bitbucket.
But the error you are facing is different. As you are coping the node modules also from 1 computer to another it is creating issue as it might happen that both PC has different node & npm version.
So never commit node_modules folder. It is auto create folder which will download all the dependencies when you hit npm install. So I suggest you to delete node_modules and then hit npm install and then start the project through npm start
You should look into using a source control software such as Git. You can create a free account at https://github.com and store your project on there. This allows you to modify it from any computer that has access
Please use something like git for this purpose.
You also could make a git file sync over your dropbox.
Related
I am trying to start a new sanity project, it keeps on failing, this is my first time using it, I have tried it on the command prompt and in my vscode terminal, always fail at exactly here:
PS C:\Users\USER\Documents\portfolio> cd .\backend_sanity
PS C:\Users\USER\Documents\portfolio\backend_sanity> npm create sanity#latest -- --coupon javascriptmastery2022
Coupon "javascriptmastery2022" validated!
You're setting up a new project!
We'll make sure you have an account with Sanity.io. Then we'll
install an open-source JS content editor that connects to
the real-time hosted API on Sanity.io. Hang on.
Press ctrl + C at any time to quit.
Prefer web interfaces to terminals?
You can also set up best practice Sanity projects with
your favorite frontends on https://www.sanity.io/templates
Looks like you already have a Sanity-account. Sweet!
✔ Fetching existing projects
? Project name: website
Your content will be stored in a dataset that can be public or private, depending on
whether you want to query your content with or without authentication.
The default dataset configuration has a public dataset named "production".
? Use the default dataset configuration? Yes
✔ Creating dataset
? Project output path: C:\Users\USER\Documents\portfolio\backend_sanity
? Select project template Clean project with no predefined schemas
? Do you want to use TypeScript? Yes
✔ Bootstrapping files from template
✔ Resolving latest module versions
✔ Creating default project files
? Package manager to use for installing dependencies? npm
Running 'npm install --legacy-peer-deps'
npm WARN deprecated sourcemap-codec#1.4.8: Please use #jridgewell/sourcemap-codec instead
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Local\npm-cache\_logs\2023-01-01T14_05_15_828Z-debug-0.log
Error: Command failed with exit code 1 (Unknown system error -1): npm install --legacy-peer-deps
at makeError$1 (C:/Users/USER/AppData/Local/npm-cache/_npx/67a0730928194b24/node_modules/#sanity/cli/lib/_chunks/cli-0bbdf4ec.js:1614:1386)
at handlePromise (C:/Users/USER/AppData/Local/npm-cache/_npx/67a0730928194b24/node_modules/#sanity/cli/lib/_chunks/cli-0bbdf4ec.js:1694:959)
at async installDeclaredPackages (C:/Users/USER/AppData/Local/npm-cache/_npx/67a0730928194b24/node_modules/#sanity/cli/lib/_chunks/cli-0bbdf4ec.js:1694:4672)
at async initSanity (C:/Users/USER/AppData/Local/npm-cache/_npx/67a0730928194b24/node_modules/#sanity/cli/lib/_chunks/cli-0bbdf4ec.js:17019:4972)
PS C:\Users\USER\Documents\portfolio\backend_sanity>
I tried to start a sanity project, I ran the command to create and it fails at the last stage
In my weather-app I am using npm run deploy command in terminal
But it gives this error:
Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the "repo" option).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! weather_app#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weather_app#0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pankaj/.npm/_logs/2021-11-22T19_38_21_874Z-debug.log
Also I don't know which command should i write to get access to my git repository which is already pushed on my github account...
I had the same issue. I solved it by putting the following commands in the terminal: git init, get remote add origin (copy and paste the url from your github repository here, the parentheses are not needed), and then npm run deploy
I cloned the repo again, did npm run deploy and it worked for me!
I had the same issue. I believe it was because I forgot to run "git init" at the start of development. I just cloned my repository and it sorted itself out.
I had this issue too...:
Initially I had my project on external hard disk so I made a local copy of my project and tried the "npm run deploy" command again and it worked for me. (Just make sure your remote origin is correct).
I hope this helps.
I'm trying to install #tensorflow/tfjs-node#3.2.1 (latest).
I have follow a lot of other questions I saw regarding such problems but haven't found an answer for this specific issue.
I have installed visual studio with the requested build tools.
node 14.15.5
Tried with and without the flag.
This is the output of the install command:
$ npm install #tensorflow/tfjs-node --build-from-source
npm WARN deprecated node-pre-gyp#0.14.0: Please upgrade to #mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the #mapbox scoped package will recieve updates in the future
> #tensorflow/tfjs-node#3.2.0 install C:\Users\dark_\Desktop\projects\tfjs2\node_modules\#tensorflow\tfjs-node
> node scripts/install.js
CPU-windows-3.2.0.zip
* Downloading libtensorflow
* Building TensorFlow Node.js bindings
symlink ./lib/napi-v7 failed: null
npm WARN tfjs2#1.0.0 No description
npm WARN tfjs2#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #tensorflow/tfjs-node#3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #tensorflow/tfjs-node#3.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dark_\AppData\Roaming\npm-cache\_logs\2021-02-27T18_14_41_492Z-debug.log
After spening a day trying the usual suspects (node-gyp reinstall as global, windows building tools (re)install as global, parameter settings, etc) I've debugged the install script and found an error in it: after the symlink stuff, the author didn't check the "error" variable, and went straight to process.exit(1)
After I tore out my hair, I've found that the solution is on it's way:
https://github.com/tensorflow/tfjs/commit/2e745c8b6efe5ffc396a86cfc50347e629091248
It has been commited to the main branch (2021.02.26), so probably we'll see it in v3.3.0, or v3.2.x
Now the problem is, that if you just do a simple npm install #tensorflow\tfjs-node, the installer sees it as an error, and deletes the whole downloaded directory in node_modules. You COULD prevent the whole thing by:
EXECUTING npm install #tensorflow/tfjs-node --ignore-scripts
THEN correcting the error by hand in the install script (check the commit at the above link) and
RUNNING npm rebuild #tensorflow/tfjs-node --build-from-source.
I needed to restart VSCode, because it had difficulties picking up the references. But if you don't want to mess arround, go back to the v2.x branch for the time being.
Recently I was building a very basic react projector for learning reasons and I faced with a very annoying problem described by theses logs:
npm ERR! errno 1
npm ERR! react-tutorial-guide#0.1.0 eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-tutorial-guide#0.1.0 eject script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2021-01-09T22_43_29_500Z-debug.log
I did a quick search, spent a lot of hours I finally I found the problem.
There was some unstaged change in my projects so I should do:
git add .
git commit -am "some message"
to solve the problem, I did it and in the principle, the problem wasn't been solved. I saw more carefully my project and I could see that git local repositories outside my react projects folder was been considered as unstaged changes. So when I try to commit my project by the commands above, it failed and consequentially the problem wasn't been solved what doesn't make sense they were outside my project folder and I was inside my project folder when I executed the git commands to solve the problem.
I investigated more carefully to solve the problem, so I noted that My reacts project is inside a folder, where there is other react projects, and this React projects folder was inside the document user folder, to be more precise in this path on my os system (windows 10): C:\Users(USER_NAME)\Documents
To solve the problem I simply deleted the folder where there were local git repositories and finally I could execute the wanted task:
npm run eject
I know this solution is very bad, but it was the only one that I was able to do and it is too annoying because it will cause me future problem in the react projects where I have to execute
npm run eject
in my projects when it were needed. I'm finding a better solution and if someone could show me how to avoid this issue I would be too thankfully.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2021-01-09T22_43_29_500Z-debug.log
In my opinion, it is not a problem with git. The error which you got is probably because of the way that you have installed the node or npm in your system. Maybe by updating the npm would have also solved your problem.
npm install -g npm
You can also download the latest version of node.js from the official site.
There is an another way of updating the node through node version manager(nvm). Please follow the instruction for installing or updating the nvm.
*npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:*
or sometimes I am different kind of errors just after creating the app. which means no modifications to the default automatic generated project.
and I managed to solved it.
the issue seems to be with my Yarn. incomplete uninstall or something like that. can't solve it by just reinstalling Yarn or uninstall it again. because of that, NPM create-react-app also create bugs, which IDK how.
but the solution is amazing, I just created the project in a different folder. trust me I'm not lying , different location do works in NPM. so I believe I need to format my computer to solve this 100%.
The cause maybe due to I have installed create-react-app via NPM globally and tries to install Yarn create-react-app.
anyway, by using a different folder location, my issue was fixed completely.