yarn - installation of deasync fails - node-gyp

When I create a react app on Windows with node 15 like this:
yarn create react-app my-project --template typescript
It fails with
yarn create v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.9: The platform "win32" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.0.6: The platform "win32" is incompatible with this module.
info "fsevents#2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/4] ⠁ waiting...
[-/4] ⠁ waiting...
[3/4] ⠂ deasync
error C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync
Output:
C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp#7.1.2
gyp info using node#15.0.1 | win32 | x64
gyp info find Python using Python version 3.7.3 found at "C:\Users\teyc\AppData\Local\Programs\Python\Python37-32\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.8.30717.126) found at:
I don't want to install compilers. Are there binaries available for downloading?

Unfortunately, the deasync node package might not contain every binary for your node version and operating system, and yarn for some inexplicable reason requires it when running create react-app while npx doesn't.
Your options are:
Figure out how to download the prebuilt binaries into your system
https://github.com/abbr/deasync-bin
use npx
npx create react-app my-project --template typescript
use yarn 2. This is the method I prefer as it consumes less disk space
yarn set version berry
yarn create react-app myproject --template typescript

Related

What am i doing wrong?, Am creating react app with, npx create-react-app app_name. but i keep getting thing unusual error

C:\Users\user>npx create-react-app my-app-redux-demo
Creating a new React app in C:\Users\user\my-app-redux-demo.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
core-js#2.6.12 postinstall C:\Users\user\my-app-redux-demo\node_modules\babel-runtime\node_modules\core-js
node -e "try{require('./postinstall')}catch(e){}"
core-js#3.9.0 postinstall C:\Users\user\my-app-redux-demo\node_modules\core-js
node -e "try{require('./postinstall')}catch(e){}"
core-js-pure#3.9.0 postinstall C:\Users\user\my-app-redux-demo\node_modules\core-js-pure
node -e "try{require('./postinstall')}catch(e){}"
ejs#2.7.4 postinstall C:\Users\user\my-app-redux-demo\node_modules\ejs
node ./postinstall.js
cra-template#1.1.2
react-scripts#4.0.2
react-dom#17.0.1
react#17.0.1
added 1903 packages from 722 contributors and audited 1906 packages in 463.186s
127 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
Git repo not initialized Error: Command failed: git --version
at checkExecSyncError (child_process.js:611:11)
at execSync (child_process.js:647:15)
at tryGitInit (C:\Users\user\my-app-redux-demo\node_modules\react-scripts\scripts\init.js:46:5)
at module.exports (C:\Users\user\my-app-redux-demo\node_modules\react-scripts\scripts\init.js:283:7)
at [eval]:3:14
at Script.runInThisContext (vm.js:131:20)
at Object.runInThisContext (vm.js:297:38)
at Object. ([eval]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at evalScript (internal/process/execution.js:94:25) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 6444,
stdout: null,
stderr: null
}
Installing template dependencies using npm...
npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-zJmm08OqHoWE/tbPBA3EoM3NqC+jSXNrjmFOL793hAbIsvaQb1AGlZwyklCdorV7Smk99/CUEbGMX4WyYp9eOQ== integrity checksum failed when using sha512: wanted sha512-zJmm08OqHoWE/tbPBA3EoM3NqC+jSXNrjmFOL793hAbIsvaQb1AGlZwyklCdorV7Smk99/CUEbGMX4WyYp9eOQ== but got sha512-bT3IYAdf9Eqxmgn6hiWRbSzk6tLXQqI9oMekX8vYrhnaMN7MK7A7uYzVR2dlbf0vqr5HvYW2DOV61NEoGJXTVQ==.
(180727 bytes)
npm WARN registry Using stale data from http://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code EINTEGRITY
npm ERR! errno EINTEGRITY
npm ERR! Invalid response body while trying to fetch http://registry.npmjs.org/#testing-library%2fuser-event: Integrity verification failed for sha512-zJmm08OqHoWE/tbPBA3EoM3NqC+jSXNrjmFOL793hAbIsvaQb1AGlZwyklCdorV7Smk99/CUEbGMX4WyYp9eOQ== (C:\Users\user\AppData\Roaming\npm-cache_cacache\content-v2\sha512\cc\99\a6d3c3aa1e8584fed6cf040dc4a0cdcda82fa349736b8e614e2fbf778406c8b2f6906f5006959c3292509da2b57b4a693df7f09411b18c5f85b2629f5e39)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2021-02-19T14_10_23_648Z-debug.log
npm install --save #testing-library/jest-dom#^5.11.4 #testing-library/react#^11.1.0 #testing-library/user-event#^12.1.10 web-vitals#^1.0.1 failed
Looks like the directory where you ran CRA doesn't allow initializing a git repo. Could it be read-only?. Try git init in a new directory in the same path and if it fails - troubleshoot that. Once it succeeds, CRA should work too.
Check to ensure that you have correctly installed git by following the installation process outlined on https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.
After installing, you can confirm that git is installed by running git --version (what React is trying to do). Currently, you will likely see an error trying to run this command as git is not installed. Post-install, you should see a version number being displayed.
After installing git, run your create-react-app again.

sysmlink error when installing tensorflow/tfjs-node

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.

gyp ERR! configure error in ubuntu while installing angular 4 project

I am a new bee in angular4. I am setting up an angular4 project (it's a simple admin panel) using npm install, but it's showing
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied,
It is happening to any angular4 projects, but simple angular4 program is working properly.
Go to project directory. and if you use mac than run below command, or for windows run the following without sudo,
sudo npm uninstall
sudo npm clean cache
sudo npm install
sudo npm install #angular/cli

IBM MFP cli install failure: npm install -g mfpdev-cli

When I attempt to install the IBM Mobile First CLI (mfpdev-cli), I'm getting an error.
Command:
npm install -g mfpdev-cli
Error details:
npm ERR! path /Users/timothy/dev/project/mdo-windows-support/package.json
npm ERR! code ENOPACKAGEJSON
...
npm ERR! package.json npm can't find a package.json file in your current directory.
It looks like it's trying to create an npm named 'mdo-windows-support' locally, but it fails. Any suggestions?
npm version: 5.0.1
node version: v8.0.0
Okay, it turns out that the versions of npm/node were the culprit. I switched back to the LTS version of Node, and it worked.

node-gyp troubles with installation

I'm trying to install webworker-threads, a node addon that requires gyp. I followed the gyp instructions for setup, so far I'm still getting an error when trying to "rebuild":
C:\Program Files\nodejs\node_modules\webworker-threads>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:980:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:34)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\webworker-threads
gyp ERR! node -v v0.10.8
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
I'm on a Windows 7 32 bit system.
Sooo to spare some time here's my personal checklist:
Paths: node is in both user and system path. npm is in user path. Python path is set too.
Python: 2.7.3 installed at C:\Python27
VisualStudio C++ 2010 AND 2012 Express installed
node version v0.10.8
ran everything with administrator privileges
Commands executed: npm install -g node-gyp
npm install webworker-threads
Then the error appears.
Do you guys by any chance notice something I'm doing wrong?
Thanks a lot in advance for your guidance!
try npm install –msvs_version=2012. This command will ask NPM to use visual studio 2012 to build.
http://www.kevgriffin.com/specifying-visual-studio-version-in-npm-installs/
After spending a while to get this to work (for me accepted answer didn't work, for me it's just half solution) i did following:
Sadly, you must have visual studio (i installed express edition 2013 for DESKTOP)
Installed python 2.7.3 (you don't have to set any environment variables)
Run cmd as administrator and go to you project root (where is you package.json file)
First run: npm config set python C:\Python27\python.exe
Then: npm install -msvs_version=2013
The trick is in command npm config set python ...path_to_python_exe... which will be provided by npm to dependency which needs python i guess.
Got Windows 7 64 bit.
Did all the above but I still got the error which was mentioned.
What worked for me was:
Uninstall Microsoft .NET Frameworks (I got more than one version)
Open regedit and navigating to:
hkey_local_machine/software/Microsoft/MSBuild
Remove all .net versions (I got there 2 and 3.5 sub directories)
If You have OS 64 Bit repeat steps 2 & 3 for %WinDir%\SysWOW64\regedit.exe
Reinstall Microsoft .NET Framework
Hope it will spare some time for you.

Resources