Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js npm开始显示错误,代码为npm ERR!代码失效循环_Node.js_Reactjs - Fatal编程技术网

Node.js npm开始显示错误,代码为npm ERR!代码失效循环

Node.js npm开始显示错误,代码为npm ERR!代码失效循环,node.js,reactjs,Node.js,Reactjs,当我尝试加载从web下载的项目时,它显示以下错误。我尝试了clean cache和npm安装,但仍然显示以下错误 > reactjs-basics@1.0.0 start D:\React\reactjs-basics-11-router > npm run build > reactjs-basics@1.0.0 build D:\React\reactjs-basics-11-router > webpack -d && cp src/index.

当我尝试加载从web下载的项目时,它显示以下错误。我尝试了clean cache和npm安装,但仍然显示以下错误

> reactjs-basics@1.0.0 start D:\React\reactjs-basics-11-router
> npm run build


> reactjs-basics@1.0.0 build D:\React\reactjs-basics-11-router
> webpack -d && cp src/index.html dist/index.html && webpack-dev-server --content-base src/ --inline --hot --history-api-fallback

Hash: e5125e0911e8a3ceea45
Version: webpack 1.15.0
Time: 1807ms
        Asset     Size  Chunks             Chunk Names
    bundle.js     1 MB       0  [emitted]  main
bundle.js.map  1.09 MB       0  [emitted]  main
    + 251 hidden modules
'cp' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs-basics@1.0.0 build: `webpack -d && cp src/index.html dist/index.html && webpack-dev-server --content-base src/ --inline --hot --history-api-fallback`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactjs-basics@1.0.0 build 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\Aqib.Saman\AppData\Roaming\npm-cache\_logs\2018-10-29T06_47_07_547Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs-basics@1.0.0 start: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactjs-basics@1.0.0 start 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\Aqib.Saman\AppData\Roaming\npm-cache\_logs\2018-10-29T06_47_07_609Z-debug.log
我试着把cp改成一些人说的复制,但后来我发现了下面的错误

The syntax of the command is incorrect.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs-basics@1.0.0 build: `webpack -d && copy src/index.html dist/index.html && webpack-dev-server --content-base src/ --inline --hot --history-api-fallback`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactjs-basics@1.0.0 build 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\Aqib.Saman\AppData\Roaming\npm-cache\_logs\2018-10-29T08_03_45_949Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactjs-basics@1.0.0 start: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactjs-basics@1.0.0 start 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\Aqib.Saman\AppData\Roaming\npm-cache\_logs\2018-10-29T08_03_46_008Z-debug.log

如果有人能帮上忙,那就好像出了什么问题,我们会非常感激你的问题来自于这里的复制操作
webpack-d&&cp src/index.html dist/index.html

我假定您正在使用windows操作系统运行此代码,并且windows中没有
cp
命令

你应该试着用这个替换上面的

     `webpack -d && copy src/index.html dist/index.html`

以下行中的
cp
是什么:
webpack-d&&cp-src/index.html dist/index.html&&webpack-dev-server--content-base-src/--inline--hot--history-api fallback