草庐IT

npm install loom-truffle-provider 报错

taiyosen 2023-10-19 原文

环境

  • win10
  • node v16.13.2

问题

学习CryptoZombies的教程,于是使用npm安装truffle: npm i truffle -g,结果装了老半天报错了:

...
600 verbose stack Error: The git reference could not be found
600 verbose stack     at makeError (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\git\lib\make-error.js:26:13)
600 verbose stack     at C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\git\lib\spawn.js:37:26
600 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:96:5)
600 verbose stack     at async Object.withTempDir (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\fs\lib\with-temp-dir.js:23:14)
600 verbose stack     at async Arborist.[nodeFromEdge] (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1101:19)
600 verbose stack     at async Arborist.[buildDepStep] (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:970:11)
600 verbose stack     at async Arborist.buildIdealTree (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:216:7)
600 verbose stack     at async Promise.all (index 1)
600 verbose stack     at async Arborist.reify (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:153:5)
600 verbose stack     at async Install.exec (C:\Users\fygame\AppData\Roaming\npm\node_modules\npm\lib\commands\install.js:159:5)
601 verbose cwd C:\Users\fygame\AppData\Local\npm-cache\_cacache\tmp\git-cloneKsTTeb
602 verbose Windows_NT 10.0.19041
603 verbose node v16.13.2
604 verbose npm  v8.6.0
605 error code 1
606 error The git reference could not be found
607 error command git --no-replace-objects checkout 4.0
608 error error: pathspec '4.0' did not match any file(s) known to git
609 verbose exit 1
610 timing npm Completed in 9389ms
611 verbose unfinished npm timer reify 1653969341713
612 verbose unfinished npm timer reify:loadTrees 1653969341729
613 verbose code 1
614 error A complete log of this run can be found in:
614 error     C:\Users\fygame\AppData\Local\npm-cache\_logs\2022-05-31T03_55_41_489Z-debug-0.log

关键的错误信息是

608 error error: pathspec '4.0' did not match any file(s) known to git

联系上下文,大概是依赖包中有个gulp@4.0,然而这个版本已经被官方从git上移除了。
stackoverflow上有个一样的问题:https://stackoverflow.com/questions/70563516/npm-install-giving-error-pathspec-4-0-did-not-match-any-files-known-to-git
其中有个回答,提到用node11就好了。那咱就试试。我想只在安装truffle时使用node11,平时还是使用node16,于是引入下一个问题,如果管理多个版本的nodejs?

使用nvs管理不同版本NodeJs

很简单,npm的github上明明白白告诉你了~

  • nvm
  • nvs
  • nave
  • n
  • volta
  • nodenv
  • asdf-nodejs
  • nvm-windows
  • fnm
    nvm我之前用过,不过它没有官方的windows安装包,要通过脚本安装,略麻烦。有第三方维护的nvm-windows,不过我试了一下,安装node11.15.0时报错了,原因是它在下载npm失败了。mmm...那换一个吧,看看这个nvs,官方介绍说是受nvm启发,而且是跨平台的,感觉就比nvm高级,也有官方的windows安装包。安装后,输入命令nvs就可以选择要安装的nodejs版本,比nvm方便多啦~

说明:nvs不能改变安装目录,会安装到%LOCALAPPDATA%/nvs

C:\Users\fygame>nvs
Downloading [###########################################################################################] 100%
Extracting  [###########################################################################################] 100%
PATH += %LOCALAPPDATA%\nvs\node\11.15.0\x64

查看node版本

C:\Users\fygame>node -v
v11.15.0

查看已经安装的node

C:\Users\fygame>nvs list
 >node/11.15.0/x64

查看某个版本node的安装目录

C:\Users\fygame>nvs which 11.15.0
C:\Users\fygame\AppData\Local\nvs\node\11.15.0\x64\node.exe

呜呜,安装到C盘了,我C盘空间不大够,那把npm全局模块目录改到E盘吧:)

C:\Users\fygame>npm config set prefix E:\npm\prefix

C:\Users\fygame>npm config get prefix
E:\npm\prefix

安装下truffle试试

C:\Users\fygame>npm i truffle -g
npm WARN deprecated uuid@2.0.1: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
...
> truffle@5.5.16 postinstall E:\npm\prefix\node_modules\truffle
> node ./scripts/postinstall.js

Error: Error while attempting to download and cache solc 0.5.16: Command failed: node ./build/cli.bundled.js obtain --solc=0.5.16
    at postinstallObtain (E:\npm\prefix\node_modules\truffle\scripts\postinstall.js:13:11)
    at Object.<anonymous> (E:\npm\prefix\node_modules\truffle\scripts\postinstall.js:20:3)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @zondax/filecoin-signing-tools@github:trufflesuite/filecoin-signing-tools-js (node_modules\truffle\node_modules\@trufflesuite\filecoin.js\node_modules\@zondax\filecoin-signing-tools):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: Error while executing:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: undefined ls-remote -h -t ssh://git@github.com/trufflesuite/filecoin-signing-tools-js.git
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: spawn git ENOENT
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\truffle\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN ajv-formats@2.1.1 requires a peer of ajv@^8.0.0 but none is installed. You must install peer dependencies yourself.

+ truffle@5.5.16
added 1141 packages from 768 contributors in 930.877s

前面那个报错没了,但是这个新的报错(看起来似乎是执行一段安装后的脚本报错了)似乎也不影响truffle的使用。
使用下truffle看看

G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle>truffle
'truffle' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle>npx truffle
(node:6492) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
Error: Error while attempting to download and cache solc 0.5.16: Command failed: node ./build/cli.bundled.js obtain --solc=0.5.16
    at postinstallObtain (C:\Users\admin\AppData\Roaming\npm-cache\_npx\8332\node_modules\truffle\scripts\postinstall.js:13:11)
    at Object.<anonymous> (C:\Users\admin\AppData\Roaming\npm-cache\_npx\8332\node_modules\truffle\scripts\postinstall.js:20:3)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11
Error: Node version not supported. You are currently using version 11.15.0 of Node. Truffle requires Node v12.0.0 or higher.

这...truffle需要node 12.0.0以上... 看来stackoverflow也不一定靠谱。那就装个node v12.22.12吧~安装过程和上面一样。
把node12设为默认

G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle>nvs link 12.22.12
%LOCALAPPDATA%\nvs\default -> %LOCALAPPDATA%\nvs\node\12.22.12\x64

重新安装truffle,这次上面那两个报错都没有了!

G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle>npm i truffle -S
npm WARN deprecated uuid@2.0.1: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated cids@0.7.5: This module has been superseded by the multiformats module
npm WARN deprecated multicodec@0.5.7: This module has been superseded by the multiformats module
npm WARN deprecated multicodec@1.0.4: This module has been superseded by the multiformats module
npm WARN deprecated multibase@0.6.1: This module has been superseded by the multiformats module
npm WARN deprecated multibase@0.7.0: This module has been superseded by the multiformats module
npm WARN deprecated uuid@3.2.1: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated cids@1.1.9: This module has been superseded by the multiformats module
npm WARN deprecated multibase@3.1.2: This module has been superseded by the multiformats module
npm WARN deprecated multibase@4.0.6: This module has been superseded by the multiformats module
npm WARN deprecated multicodec@3.2.1: This module has been superseded by the multiformats module
npm WARN deprecated ipld-dag-pb@0.20.0: This module has been superseded by @ipld/dag-pb and multiformats
npm WARN deprecated ipld-dag-cbor@0.17.1: This module has been superseded by @ipld/dag-cbor and multiformats
npm WARN deprecated multicodec@2.1.3: This module has been superseded by the multiformats module
npm WARN deprecated ipld-raw@6.0.0: This module has been superseded by the multiformats module
npm WARN deprecated @nodefactory/filsnap-adapter@0.2.2: Package is deprecated in favour of @chainsafe/filsnap-adapter

> @trufflesuite/bigint-buffer@1.1.9 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ganache\node_modules\@trufflesuite\bigint-buffer
> node-gyp-build || echo "Couldn't build bindings. Non-native version used."


> bufferutil@4.0.5 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ganache\node_modules\bufferutil
> node-gyp-build


> keccak@3.0.1 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ganache\node_modules\keccak
> node-gyp-build || exit 0


> leveldown@6.1.0 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ganache\node_modules\leveldown
> node-gyp-build


> secp256k1@4.0.2 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ganache\node_modules\secp256k1
> node-gyp-build || exit 0


> utf-8-validate@5.0.7 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ganache\node_modules\utf-8-validate
> node-gyp-build


> iso-constants@0.1.2 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\iso-constants
> node build.js > index.browser.js


> bufferutil@4.0.6 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\bufferutil
> node-gyp-build


> secp256k1@4.0.3 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\secp256k1
> node-gyp-build || exit 0


> ursa-optional@0.10.2 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\ursa-optional
> node rebuild.js

ursaNative bindings compilation fail. This is not an issue. Modules that depend on it will use fallbacks.

> utf-8-validate@5.0.9 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\utf-8-validate
> node-gyp-build


> keccak@3.0.2 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\keccak
> node-gyp-build || exit 0


> leveldown@5.6.0 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\leveldown
> node-gyp-build


> sqlite3@4.2.0 install G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: "G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\sqlite3\lib\binding\node-v72-win32-x64\node_sqlite3.node" is installed via remote

> @apollo/protobufjs@1.2.2 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\@apollo\protobufjs
> node scripts/postinstall


> protobufjs@6.11.3 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\protobufjs
> node scripts/postinstall


> es5-ext@0.10.61 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\es5-ext
>  node -e "try{require('./_postinstall')}catch(e){}" || exit 0


> web3-shh@1.5.3 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\web3-shh
> echo "WARNING: the web3-shh api will be deprecated in the next version"

"WARNING: the web3-shh api will be deprecated in the next version"

> web3-bzz@1.5.3 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\web3-bzz
> echo "WARNING: the web3-bzz api will be deprecated in the next version"

"WARNING: the web3-bzz api will be deprecated in the next version"

> web3@1.5.3 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\web3
> echo "WARNING: the web3-shh and web3-bzz api will be deprecated in the next version"

"WARNING: the web3-shh and web3-bzz api will be deprecated in the next version"

> truffle@5.5.16 postinstall G:\tgit\eth\cryptozombiestrial\oracle\EthPriceOracle\node_modules\truffle
> node ./scripts/postinstall.js

- Fetching solc version list from solc-bin. Attempt #1
- Fetching solc version list from solc-bin. Attempt #1
- Fetching solc version list from solc-bin. Attempt #1
- Downloading compiler. Attempt #1.
- Fetching solc version list from solc-bin. Attempt #1
- Downloading compiler. Attempt #1.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for peer-id@0.14.8: wanted: {"node":">=14.0.0"} (current: {"node":"12.22.12","npm":"6.14.16"})
npm WARN notsup Not compatible with your version of node/npm: peer-id@0.14.8
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @zondax/filecoin-signing-tools@github:trufflesuite/filecoin-signing-tools-js (node_modules\@trufflesuite\filecoin.js\node_modules\@zondax\filecoin-signing-tools):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error while executing:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: D:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/trufflesuite/filecoin-signing-tools-js.git
npm WARN optional SKIPPING OPTIONAL DEPENDENCY:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ssh: connect to host github.com port 22: Connection refused
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fatal: Could not read from remote repository.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Please make sure you have the correct access rights
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: and the repository exists.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: exited with error code: 128
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN ajv-formats@2.1.1 requires a peer of ajv@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN EthPriceOracle@1.0.0 No description
npm WARN EthPriceOracle@1.0.0 No repository field.

+ truffle@5.5.16
added 1141 packages from 768 contributors and audited 1144 packages in 242.581s

100 packages are looking for funding
  run `npm fund` for details

found 16 vulnerabilities (6 low, 4 moderate, 6 high)
  run `npm audit fix` to fix them, or `npm audit` for details

结论

安装truffle,需要node v12.0.0以上(我用的v12.22.12),node v16.13.2可能不支持。

有关npm install loom-truffle-provider 报错的更多相关文章

  1. 深度学习部署:Windows安装pycocotools报错解决方法 - 2

    深度学习部署:Windows安装pycocotools报错解决方法1.pycocotools库的简介2.pycocotools安装的坑3.解决办法更多Ai资讯:公主号AiCharm本系列是作者在跑一些深度学习实例时,遇到的各种各样的问题及解决办法,希望能够帮助到大家。ERROR:Commanderroredoutwithexitstatus1:'D:\Anaconda3\python.exe'-u-c'importsys,setuptools,tokenize;sys.argv[0]='"'"'C:\\Users\\46653\\AppData\\Local\\Temp\\pip-instal

  2. ruby - Net::HTTP SocketError: getaddrinfo: nodename 或 servname provided, or not known - 2

    我用谷歌搜索了这个问题并浏览了关于这个问题的相关帖子。我认为这不是Rails/Ruby问题,但不确定下一步该怎么做。irb(main):007:0>Net::HTTP.get_response("http://www.apple.com","")SocketError:getaddrinfo:nodenamenorservnameprovided,ornotknownfrom/Users/dan/.rbenv/versions/2.2.3/lib/ruby/2.2.0/net/http.rb:879:in`initialize'否则没有网络问题。apple.com在浏览器中加载正常。这

  3. ruby-on-rails - 报错 - 在 Snow Leopard 上安装 RVM - 2

    我正在尝试在我的SnowLeopard10.6.8上安装RVM,方法是:\curl-Lhttps://get.rvm.io|bash-sstable--ruby我得到这个错误:InstallingRubyfromsourceto:/Users/Villa/.rvm/rubies/ruby-2.0.0-p0,thismaytakeawhiledependingonyourcpu(s)...ruby-2.0.0-p0-#downloadingruby-2.0.0-p0,thismaytakeawhiledependingonyourconnection...ruby-2.0.0-p0-#e

  4. Unity 报错No ‘git‘ executable was found. Please install Git on your system then restart - 2

    亲测可用。Anerroroccurredwhileresolvingpackages:Projecthasinvaliddependencies: com.unity.xxx:No'git'executablewasfound.PleaseinstallGitonyour  systemthenrestartUnityandUnityHub在我们使用PackageManager时,Unity允许我们使用Git上的package(点击加号,选择addpackagefromgitURL,或者是直接在Asset/Packages/manifest.json中添加包名)。但是这种操作需要我们事先装好g

  5. ruby-on-rails - Rails/Ruby创建数据库报错: Unable to load the EventMachine C extension - 2

    更新:eventmachinegem已安装并在我的gemfile中:eventmachine(1.0.0,0.12.10)请帮忙!尝试使用以下内容创建数据库:Fitzs-MacBook-Pro:twilio_insanityFitz$rakedb:create'返回以下错误:UnabletoloadtheEventMachineCextension;Tousethepure-rubyreactor,require'em/pure_ruby'rakeaborted!cannotloadsuchfile--rubyeventmachine/Users/Fitz/.rvm/gems/ruby

  6. nginx配置https后报错nginx: [emerg] https protocol requires SSL support in XXX.conf详细解决方法 - 2

    一、前言最近,在测试环境的nginx里增加了一个https配置:location/api-meeting-qq/{proxy_passhttps://api.meeting.qq.com/;}然后,执行命令://这个是nginx启动文件的路径,根据实际情况自行更改sudo/home/useradmin/nginx/sbin/nginx-sreload结果,nginx就报错了:nginx:[emerg]httpsprotocolrequiresSSLsupportin/home/useradmin/nginx/conf.d/trainNginx.conf:9二、解决方法百度发现,是之前安装ngi

  7. nvm报错Now using node v版本号 (64-bit)解决方法 - 2

    nvm报错Nowusingnodev版本号(64-bit)解决方法先上报错(安装后的一些问题请直接跳到尾部查看)安装NVM的原因是使用React时addreact-redux时提示我node版本问题,遂打算安装一Node版本管理工具因为我电脑上很早就安装了Node,安装NVM时提示我是否覆盖并管理本地已有版本,我选了Yes之后安装成功(后来检查发现和版本没关系,是因为我在node里去ADD真离谱自己这操作)安装NVM注意问题1.若修改安装路径一定补上nodejs2.打开安装文件位置3.增加以下映射node_mirror:npm.taobao.org/mirrors/node/npm_mirro

  8. git push报错:fatal: Authentication failed for ‘https://github.com/... - 2

    第一次用git传代码到GitHub时,填写用户名和密码出现报错:fatal:Authenticationfailedfor'https://github.com/试了下面的没用😢gitconfig-–globaluser.name"xxx"gitconfig--globaluser.email"xxx@xx.com"查看报错原因发现是因为git更新了认证方式在错误提示(糟糕忘截图)的网站里有说明-->https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-

  9. ruby - 在 Ruby 中,为什么在启动 irb 之后出现 foo.nil?说未定义的错误,@foo.nil?给出 "true"和 @@wah.nil?又报错了? - 2

    在Ruby1.8.7和1.9.2中相同:$irbruby-1.8.7-p302>foo.nil?NameError:undefinedlocalvariableormethod`foo'for#from(irb):1ruby-1.8.7-p302>@bar.nil?=>trueruby-1.8.7-p302>@@wah.nil?NameError:uninitializedclassvariable@@wahinObjectfrom(irb):3为什么实例变量与局部变量和类变量的处理方式不同? 最佳答案 在Ruby中,大多数未初始化

  10. Fiddler手机抓包网络报错解决办法 - 2

    首先打开fiddler,点击Tools-Options-Connections一、这里有两个注意点点击HTTPS,左边选项选择如图,右边Actions点击如图第二项会提示Success,点击确定点击Connections,这里注意Fiddlerlistensonport这里面填写默认8888即可,左边三个选项选择如图,以上操作完成后,重启Fiddler二、手机打开WiFi1.长按或者点击Wifi进行修改网络(如不会操作,此处根据具体机型自行百度)修改代理为手动,服务器主机名两种方式可以查到:①win+R,在输入框输入cmd,在弹窗中输入ipconfig,此时IPv4后面的地址就是你的主机ip,

随机推荐