Running yarn start on Windows 10 keeps failing - windows

I am moving a web project from my Mac to a Windows 10 PC. I used Github Desktop to download all of files and I'm using Visual Studio Code to work on my project. Everytime I run both npm start or yarn start I get this error. I have tried deleting yarn.lock,package-lock.json, node_modules, using other script terminals, clearing my cache, npm install npm rebuild, yarn install. Everything I could find didn't work and I have no clue what to do. Any help would be appreciated. Thanks!
Here is the error message:
Starting the development server...
events.js:200
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

All right, look carefully at this:
{
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
errno: 'ENOENT' means the file or directory is not found
path: 'cmd' denotes the executable cmd was not found locally or globally while spawning process cmd via Node.js
Now, I don't want to go into details. Just know that your operating system needs to keep track of some variables which can be accessed globally. One of such variable is called $PATH. The executables inside directories mentioned in the $PATH can be accessed from anywhere on your system.
Here, 'C:\Windows\system32' is a path where windows keeps some critical executables. cmd.exe is one of them. Somehow the path was deleted from the $PATH variable. In order to fix the problem, an easy solution is:
Go to start-menu -> search and type environment variables and open it
There will be a variable named PATH. Append C:\Windows\system32 to it and press OK. If you're on Windows 7 or below, add a semi-colon ; before it
Restart your terminal or IDE or code editor and try running the app. See if the error comes again

Related

Issues running "yarn build" while creating Solana NFTs

I've been having issues running "yarn build" for a few days now. I tried the suggestions I could find online without much luck. This is for an NFT project on Solana so hoping another dev on here may have ran into and has the fix.
Things I've tried:
Downgrading to earlier versions of node js, ts-node, yarn, and solana.
Deleting package-lock.json.
Any other suggestions out there would be much appreciated. Thanks in advance!
Command line output below:
C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js>yarn build
yarn run v1.22.10
$ lerna run build
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 5 packages: "yarn run build"
lerna ERR! yarn run build exited 1 in 'candy-machine-mint'
lerna ERR! yarn run build stdout:
$ react-scripts build
Creating an optimized production build...
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build stderr:
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at runSyncOrAsync (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array.<anonymous> (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\packages\fair-launch\node_modules\react-scripts\scripts\build.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:417:16)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:452:10
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:323:13
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\babel-loader\lib\index.js:59:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.2.0
error Command failed with exit code 1.
lerna ERR! yarn run build exited 1 in 'candy-machine-mint'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It is the node.js version used with old code that is causing the error. Uninstall the current version of node and install the lts version (16.13.1) and the error will be gone.

How do I get Cypress to detect my existing Chrome browser after upgrade?

After upgrading from Cypress 3.2.0 to 3.3.0, Cypress opens with only the Electron option for execution.
I've tried completely uninstalling Cypress (both versions), and re-installing from scratch with npm.
When trying to do this:
https://docs.cypress.io/guides/guides/debugging.html#Clear-App-Data
I get this:
{ Error: spawn cmd ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs:
[ '/c',
'start',
'""',
'/wait',
'C:\\Users\\James\\AppData\\Roaming\\Cypress\\cy\\production' ] }
Error: spawn cmd ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
I expect that Cypress when upgrading, wouldn't lose the location of the existing Chrome installation and that I would be able to debug the issue by clearing the app data without error.

npm Windows 7 error

I am helping someone get through running npm in Windows 7. When npm update is executed, the following error (ENOENT, scandir) is returned. But the folder that npm could not find has been verified to exist, and the user running npm has full permissions on the folder. Below are the details of the npm-debug.log for this error:
18265 silly fetchPackageMetaData errno: -4058,
18265 silly fetchPackageMetaData code: 'ENOENT',
18265 silly fetchPackageMetaData syscall: 'scandir',
18265 silly fetchPackageMetaData path: 'C:\\Users\<\userpath\>\\npm-cache\\_git-remotes\\git-github-com-polymerelements-test-fixture-git-8142662e\\HEAD' }
18266 silly rollbackFailedOptional Starting
18267 silly rollbackFailedOptional Finishing
18268 silly runTopLevelLifecycles Finishing
18269 silly install printInstalled
18270 verbose stack Error: ENOENT: no such file or directory, scandir 'C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD'
18271 verbose cwd C:\Users\\<userpath\>\git\PredixDev\predix-seed
18272 error Windows_NT 6.1.7601
18273 error argv "G:\\nodejs\\node.exe" "G:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update" "--no-optional"
18274 error node v7.2.0
18275 error npm v3.10.9
18276 error path C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD
18277 error code ENOENT
18278 error errno -4058
18279 error syscall scandir
18280 error enoent ENOENT: no such file or directory, scandir 'C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD'
18281 error enoent ENOENT: no such file or directory, scandir 'C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD'
18281 error enoent This is most likely not a problem with npm itself
18281 error enoent and is related to npm not being able to find a file.
18282 verbose exit [ -4058, true ]
I'm not familiar at all with using Node on Windows. Please help, thank you. (NOTE: I've replaced specific user folder information above with \ to sanitize the info.)
One possible cause is security software that filters access to the file system, like DigitalGuardian. If it's a corporate machine with something like that installed, you may need to get your IT people to whitelist Node.
https://github.com/npm/npm/issues/10729

Any npm's command is not working

I can attach the error log file
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli 'C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'config' ]
2 info using npm#1.4.28
3 info using node#v0.10.35
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 error Error: ENOENT, stat 'c:\'C:\Program'
6 error If you need help, you may report this entire log,
6 error including the npm and node versions, at:
6 error http://github.com/npm/npm/issues
7 error System Windows_NT 6.2.9200
8 error command "C:\Program Files\nodejs\\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "config"
9 error cwd c:\
10 error node -v v0.10.35
11 error npm -v 1.4.28
12 error path c:\'C:\Program
13 error code ENOENT
14 error errno 34
15 verbose exit [ 34, true ]
Any npm's command is not working.
I am using windows 8.1 and I installed npm successfully.
I heard that ENOENT error can be fixed if I make a folder relate to the error path but
error path contains 'C:\Program, I cannot make that file.
How can I solve this problem? I tried to uninstall npm, I failed.
This problem happened because I tried to change prefix for npm but something goes wrong
I found way to fix it.
OK, the reason why this problem happened was that I usually use CMD with administrator's admission.
Because of that setting, actually, I don't need to change prefix of npm but I just want to practice what I learn in my current book.
So I tried to change prefix but accidentally, Using
npm config set prefix C:\program files
I changed the prefix 'C:\program' like this.
because of special character : , I cannot create name of fold including : .
because of damn prefix, npm was totally not working.
I searched npm folder, I found npmrc file but it did not help.
Finally, I found .npmrc at C:\Users\myName .
there, the prefix was setted at C:\program .
I delete prefix and Now it is working!!!!!
Bye Bye let's master nodejs

Node.js failed to install global npm packages on windows (not path)

So, I have a strange problem that I'm not even sure I can identify. I just installed the current version of Node.js (v.10.*) on my Windows 7 machine. I have tried to install a couple packages globally (gulp and yoeman), but I get errors when they are installing and in my C:\Users\Michael\AppData\Roaming\npm\node_modules directory, many of the package files are missing. Obviously, when I try to run the command globally, it fails because there IS NO command. It was never created.
Some other globally installed packages work fine (bower and grunt).
To make things really tricky. When I install gulp to a local folder (without the -g), the install works perfectly and I can use gulp by prepending the entire path before the command. Obviously, I could add that path to my system properties so the command would be global, but that wouldn't really fix my problem. Why does the install produce errors when installing globally, but not when installing locally?
As I watch the directory while gulp is installing locally, I see the files being created. Then the first error comes along and many of the files are deleted.
I believe the relevent parts of the log for my gulp install are:
6949 verbose lock lodash.noop#2.4.1 C:\Users\Michael\AppData\Roaming\npm-cache\7e62c2bb-lodash-noop-2-4-1.lock
6950 error Error: ENOENT, lstat 'C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool'
6951 error If you need help, you may report this *entire* log,
6951 error including the npm and node versions, at:
6951 error <http://github.com/npm/npm/issues>
6952 error System Windows_NT 6.1.7601
6953 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp"
6954 error cwd c:\wamp\www\phoenix\animus\gulp
6955 error node -v v0.10.28
6956 error npm -v 1.4.9
6957 error path C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6958 error fstream_path C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6959 error fstream_unc_path \\?\C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6960 error fstream_type Directory
6961 error fstream_class DirWriter
6962 error code ENOENT
6963 error errno 34
6964 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
6964 error fstream_stack Object.oncomplete (fs.js:107:15)
6965 verbose exit [ 34, true ]
I have log files if that would help.
Thank you.
Windows can only support 260 characters as Max Path Length. I hope nodejs developers will resolve the nesting module approach. To do a workaround I simply change the global npm modules path to c: from AppData to get some characters and it resolves the issue. I know that this hack just provide you few characters but it is working for me.
To do so,
Open notepad in Administrator mode.
Go to location [nodejs installation directory]\node_modules\npm
Open file "npmrc" and change prefix=c:\npm
Save the file.

Resources