0
votes

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

3 Answers

1
votes

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

0
votes

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

0
votes

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