create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Issue with npx create-react-app client

Open miteshkumar77 opened this issue 6 years ago • 3 comments

I have two issues.

  1. I have wrote some server side code for handling GraphQL queries for a simple calendar app that I hope to connect to a smart pill dispenser that I am building.

I want to use react to build a front-end that will send these GraphQL queries and receive back data. When I try to run npx create-react-app client I get the following output:

The system cannot find the path specified.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

The system cannot find the path specified.

> [email protected] postinstall C:\mitesh\javascriptcode\calendar\client\node_modules\babel-runtime\node_modules\core-js  > node -e "try{require('./postinstall')}catch(e){}"

/bin/bash: node: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file bash
npm ERR! errno ENOENT
npm ERR! [email protected] postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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\kumarm4\AppData\Roaming\npm-cache\_logs\2020-03-13T20_59_26_926Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting client/ from C:\mitesh\javascriptcode\calendar
Done.

I have tried installing Java8, as I only had Java13 before this to see if that fixed the error, and then I deleted %appdata%/npm-cache and uninstalled/reinstalled nodejs.

Then I fixed my cmd.exe script location using npm config set script-shell "<cmd.exe address>"

and now I get the following output:

Creating a new React app in C:\mitesh\javascriptcode\calendar\client.

The system cannot find the path specified.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

The system cannot find the path specified.

> [email protected] postinstall C:\mitesh\javascriptcode\calendar\client\node_modules\babel-runtime\node_modules\core-js  > node -e "try{require('./postinstall')}catch(e){}"

Microsoft Windows [Version 10.0.18363.719]
(c) 2019 Microsoft Corporation. All rights reserved.
The system cannot find the path specified.

and now I am getting issue 2 as well:

  1. Whenever I execute any npm command i.e. npm -v I get The system cannot find the path sepcified. Before anything happens. I tried moving up the order of the system Path variables but this did not change anything.

How do I fix these two issues?

miteshkumar77 avatar Mar 13 '20 21:03 miteshkumar77

  1. Whenever I execute any npm command i.e. npm -v I get The system cannot find the path sepcified. Before anything happens. I tried moving up the order of the system Path variables but this did not change anything.

Does this happen only under C:\mitesh\javascriptcode\calendar?

How do I fix these two issues?

If the problem only happens under C:\mitesh\javascriptcode\calendar, then I'd recommend deleting your node_modules folder and then running npm install.

C:
cd C:\mitesh\javascriptcode\calendar\client
rd /s /q C:\mitesh\javascriptcode\calendar\client\node_modules
npm install

If the problem happens outside that directory (such as C:\temp), it may indicate that your installation of Node.js or npm has become corrupt. This happens to all of us at one time or another.

It looks like you're on Windows. I'd recommend uninstalling Node.js from Programs & Features (or whatever they're calling it these days.) Then download and reinstall Node.js.

I also recommend updating npm.

npm install npm@latest -g

robv8r avatar Mar 27 '20 03:03 robv8r

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Apr 26 '20 05:04 stale[bot]

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

stale[bot] avatar May 01 '20 06:05 stale[bot]