gpt4 book ai didi

node.js - NPM 模块 : react-csv-downloader on install gives Babel not found error

转载 作者:搜寻专家 更新时间:2023-11-01 00:05:57 25 4
gpt4 key购买 nike

我想在我的项目中安装 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"
},

请帮我安装这个包。谢谢。

最佳答案

它没有在文档中的任何地方提到,但你需要添加 babel-cli 作为你的开发依赖,它会起作用。

关于node.js - NPM 模块 : react-csv-downloader on install gives Babel not found error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40037050/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com