NPM模块:安装时的react-csv-downloader导致找不到Babel错误 [英] NPM MOdule: react-csv-downloader on install gives Babel not found error

查看:79
本文介绍了NPM模块:安装时的react-csv-downloader导致找不到Babel错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在我的项目中安装react-csv-downloader软件包的方法. 当我执行npm install react-csv-downloader --save时,出现此错误

I am looking to install react-csv-downloader package in my project. when i do npm install react-csv-downloader --save i get this error

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

I am using gulp in my project and here is my 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"
  },

请帮助我安装此软件包. 谢谢.

Please help me to install this package. Thanks.

推荐答案

文档中未提及任何地方,但是您需要添加babel-cli作为您的开发依赖项,它才能正常工作.

It's not mentioned anywhere in the docs, but you will need to add babel-cli as your dev dependency and it will work.

这篇关于NPM模块:安装时的react-csv-downloader导致找不到Babel错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆