Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.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开始显示奇怪的错误1_Node.js_Reactjs_Npm_Command Line Interface - Fatal编程技术网

Node.js npm开始显示奇怪的错误1

Node.js npm开始显示奇怪的错误1,node.js,reactjs,npm,command-line-interface,Node.js,Reactjs,Npm,Command Line Interface,我是react js新手,我已经安装了应用程序的依赖项。以下是我的软件包文件: package.json { "name": "reactapp", "version": "0.0.0", "description": "learn and test", "main": "index.js", "scripts": { "start": "webpack-dev-server --hot" }, "author": "john doe", "license": "BSD-2-Clause",

我是react js新手,我已经安装了应用程序的依赖项。以下是我的软件包文件:

package.json

{
"name": "reactapp",
"version": "0.0.0",
"description": "learn and test",
"main": "index.js",
"scripts": {
  "start": "webpack-dev-server --hot"
},
"author": "john doe",
"license": "BSD-2-Clause",
"dependencies": {
  "webpack": "~1.13.3",
  "webpack-dev-server": "~1.16.2",
  "react": "~15.3.2",
  "react-dom": "~15.3.2"
},
"devDependencies": {}
}
它抛出错误:

npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0
但是,在终端中,虽然它在脚本中没有显示任何内容,但是


“测试”:“echo\”错误:未指定测试\“&&exit 1”

在安装
nodejs legacy
时,需要使用
sudo
命令


从命令行/shell执行
sudo-apt-get-install-nodejs legacy
将解决此问题。

您运行的是什么命令导致此错误以及您的节点版本是什么?尝试从命令行/shell执行
sudo-apt-get-install-nodejs legacy
。@netchkin
npm start
@DavidR它起作用了, buddy@AbhishekDhanrajShahdeo酷。。那你能接受我的回答吗?