0

I'm new to NodeJS. I have excuted the follwing commands. 1.npm install -g create-react-app 2.create-react-app my-app

while executing the 2nd command i got an error like this

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

[email protected] postinstall E:\Projects\HighAvenue\Dashboard\dashboard\node_modules\uglifyjs-webpack-plugin node lib/post_install.js

npm ERR! file bash npm ERR! path bash npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn bash npm ERR! [email protected] postinstall: node lib/post_install.js npm ERR! spawn bash 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\Soorya\AppData\Roaming\npm-cache_logs\2018-06-26T05_00_45_645Z-debug.log

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

enter image description here

3 Answers 3

1

Thanyou all for your reply. I have fixed this issue after installing yarn. Thankyou

Sign up to request clarification or add additional context in comments.

Comments

0

Have you permission for create folder at that location where you try to install the package. if you are using use sudo command before your statements.

You can do this using the runas command with an administrator trust-level, or by right-clicking the program in the UI and choosing "run as administrator."

Thanks

6 Comments

this is the log details.
28014 info linkStuff [email protected] 28015 silly linkStuff [email protected] has E:\Projects\HighAvenue\Dashboard\dashboard\node_modules as its parent node_modules 28016 verbose linkBins [email protected] 28017 verbose linkMans [email protected] 28018 silly build [email protected] 28019 info linkStuff [email protected] 28020 silly linkStuff [email protected] has E:\Projects\HighAvenue\Dashboard\dashboard\node_modules as its parent node_modules 28021 verbose linkBins [email protected]
please let me which OS on your system.
stackoverflow.com/questions/51036405/… please answer my question in that link
i'm using windows 10
|
0

Your Node setup looks incorrect. It's not an issue with Create React App—it seems like you can't run any global Node commands.

It looks like ~/.node_modules_global/bin is not in your PATH environment variable so it can't execute global commands. That's just how Bash works—it can't guess where the command lies, you need to tell it. I would assume Node installation should do this by default but it depends on how you installed Node.

So make sure that directory is in your PATH and try again. If you use Bash, add this to your .profile and then restart the Terminal:

export PATH=$HOME/.node_modules_global/bin:$PATH

2 Comments

$ npm config set prefix /usr/local $ sudo npm install -g create-react-app $ create-react-app my-app
stackoverflow.com/questions/51036405/… please answer my question in that link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.