简体   繁体   English

松露安装问题“ -bash:松露:找不到命令”

[英]truffle installation issue “-bash : truffle: command not found”

i am trying to set up the environment for developing dapps on my mac using https://medium.com/tomochain/how-to-build-a-dapp-on-tomochain-85532a1192e7 tutorial. 我正在尝试使用https://medium.com/tomochain/how-to-build-a-dapp-on-tomochain-85532a1192e7教程来设置在Mac上开发dapp的环境。 upon installing truffle, i am unable to use truffle commands from project directories. 安装松露后,我无法使用项目目录中的松露命令。 i think there is some issue with setting up the path variable or truffle not being a global installation. 我认为设置路径变量或松露不是全局安装存在一些问题。 Here is the output from the console 这是控制台的输出

Sheikhs-MacBook-Air:~ Zubair$ node -v v10.15.1 Sheikhs-MacBook-Air:〜Zubair $节点-v v10.15.1

Sheikhs-MacBook-Air:~ Zubair$ npm -v 6.4.1 Sheikhs-MacBook-Air:〜Zubair $ npm -v 6.4.1

Sheikhs-MacBook-Air:~ Zubair$ truffle version -bash: truffle: command not found Sheikhs-MacBook-Air:〜Zubair $松露版本-bash:松露:找不到命令

Sheikhs-MacBook-Air:~ Zubair$ ./node_modules/.bin/truffle version Truffle v5.0.3 (core: 5.0.3) Solidity v0.5.0 (solc-js) Node v10.15.1 Sheikhs-MacBook-Air:〜Zubair $ ./node_modules/.bin/truffle版本Truffle v5.0.3(核心:5.0.3)Solidity v0.5.0(solc-js)节点v10.15.1

Sheikhs-MacBook-Air:~ Zubair$ cd pet-shop-tutorial Sheikhs-MacBook-Air:〜Zubair $ cd宠物商店教程

Sheikhs-MacBook-Air:pet-shop-tutorial Zubair$ truffle version -bash: truffle: command not found Sheikhs-MacBook-Air:pet-shop-tutorial Zubair $松露版本-bash:松露:找不到命令

Sheikhs-MacBook-Air:pet-shop-tutorial Zubair$ ./node_modules/.bin/truffle version -bash: ./node_modules/.bin/truffle: No such file or directory Sheikhs-MacBook-Air:pet-shop-tutorial Zubair $ ./node_modules/.bin/truffle版本-bash:./node_modules/.bin/truffle:没有这样的文件或目录

Sheikhs-MacBook-Air:pet-shop-tutorial Zubair$ npm config get prefix /Users/Zubair/pet-shop-tutorial/~.npm-global Sheikhs-MacBook-Air:pet-shop-tutorial Zubair $ npm config获取前缀/Users/Zubair/pet-shop-tutorial/~.npm-global

Turns out it was an issue with the environment path variable. 原来这是环境路径变量的问题。 needed to append "/Users/Zubair/~.npm-global/bin/" to the path variable to make truffle accessible from working directories. 需要在路径变量后附加“ /Users/Zubair/~.npm-global/bin/”,以便从工作目录中访问松露。 This answer helped me resolve the issue. 这个答案帮助我解决了这个问题。 https://ethereum.stackexchange.com/questions/52812/error-in-installing-truffle-in-macos https://ethereum.stackexchange.com/questions/52812/error-in-installing-truffle-in-macos

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM