npm开始显示奇怪的错误1

时间:2016-11-04 07:46:21

标签: node.js reactjs npm command-line-interface

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

datetime.strptime("2016-12-21", "%Y-%m-%d")

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

1 个答案:

答案 0 :(得分:3)

安装sudo时需要使用nodejs-legacy命令。

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