Я установил node.js и получаю сообщение об ошибке при использовании следующей команды:
create-react-app <folder name>
Выход:
Creating a new React app in C:\Users\Desktop\my-react-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\Desktop\my-react-app\n
ode_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
npm ERR! path C:\Users\Desktop\my-react-app\node_modules\nan\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Desktop\my
-react-app\node_modules\nan\package.json'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\Desktop
\my-react-app\node_modules\nan\package.json'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\Desktop\\my-react-app\\node_modules\\nan\\package.json\'\n at Error (nati
ve)',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Desktop\\my-react-app\\node_modules\\nan\\pac
kage.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\AppData\Roaming\npm-cache\_logs\2017-09-07T11_17_31_8
99Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts
has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting my-react-app / from C:\Users\Desktop
Done.
Проблема сохраняется при запуске от имени администратора:
Your environment has been set up for using Node.js 6.11.3 (x64) and npm.
C:\Windows\System32>npm install -g create-react-app
C:\Users\amar\AppData\Roaming\npm\create-react-app -> C:\Users\amar\AppData\R
ing\npm\node_modules\create-react-app\index.js
+ create-react-app@1.4.0
updated 1 package in 17.296s
C:\Windows\System32>create-react-app react-app
Creating a new React app in C:\Windows\System32\react-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Windows\System32\react-app\nod
odules\uglifyjs-webpack-plugin
> node lib/post_install.js
npm ERR! path C:\Windows\System32\react-app\node_modules\nan\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Windows\System32\r
t-app\node_modules\nan\package.json'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Windows\System3
eact-app\node_modules\nan\package.json'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Window
System32\\react-app\\node_modules\\nan\\package.json\'\n at Error (native)
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Windows\\System32\\react-app\\node_modules\\nan\\packag
son' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\amar\AppData\Roaming\npm-cache\_logs\2017-09-07T17_16_1
06Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scri
has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting react-app / from C:\Windows\System32
Done.
C:\Windows\System32>