NPM MOdule:安装时的react-csv-downloader会发现Babel not found错误

时间:2016-10-14 07:10:02

标签: node.js reactjs npm-install babel

我希望在我的项目中安装react-csv-downloader包。 当我做npm install react-csv-downloader --save我收到此错误

react-csv-downloader@0.1.4 postinstall /home/tops/Desktop/demo_projects/mern_stack/node_modules/react-csv-downloader
> npm run build


> react-csv-downloader@0.1.4 build /home/tops/Desktop/demo_projects/mern_stack/node_modules/react-csv-downloader
> babel src -d dist

sh: 1: babel: not found

npm ERR! react-csv-downloader@0.1.4 build: `babel src -d dist`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the react-csv-downloader@0.1.4 build script.
npm ERR! This is most likely a problem with the react-csv-downloader package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel src -d dist
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-csv-downloader
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.2.0-42-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! cwd /home/tops/Desktop/demo_projects/mern_stack/node_modules/react-csv-downloader
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
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! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/tops/Desktop/demo_projects/mern_stack/node_modules/react-csv-downloader/npm-debug.log
npm ERR! not ok code 0
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! react-csv-downloader@0.1.4 postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-csv-downloader@0.1.4 postinstall script.
npm ERR! This is most likely a problem with the react-csv-downloader package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-csv-downloader
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.2.0-42-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "react-csv-downloader" "--save"
npm ERR! cwd /home/tops/Desktop/demo_projects/mern_stack
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/tops/Desktop/demo_projects/mern_stack/npm-debug.log
npm ERR! not ok code 0

我在项目中使用gulp,这是我的package.json

"dependencies": {
    "babel-preset-react": "^6.16.0",
    "babelify": "^7.3.0",
    "bluebird": "^3.4.6",
    "body-parser": "^1.15.2",
    "browserify": "^13.1.0",
    "express": "^4.14.0",
    "fixed-data-table": "^0.6.3",
    "fs": "0.0.1-security",
    "gulp": "^3.9.1",
    "history": "^4.3.0",
    "jquery": "^3.1.1",
    "json2xls": "^0.1.2",
    "mongodb": "^2.2.10",
    "multer": "^1.2.0",
    "react": "^15.3.2",
    "react-bootstrap": "^0.30.5",
    "react-bootstrap-table": "^2.5.5",
    "react-dom": "^15.3.2",
    "react-router": "^2.8.1",
    "superagent": "^2.3.0",
    "superagent-bluebird-promise": "^4.1.0",
    "superagent-promise-headers": "^1.2.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.7.0"
  },

请帮我安装此软件包。 感谢。

1 个答案:

答案 0 :(得分:0)

文档中没有提到任何内容,但您需要添加babel-cli作为您的开发依赖项,它才能正常运行。