【问题标题】:How to install packages for a NodeJs Blockchain Project如何为 NodeJs 区块链项目安装包
【发布时间】:2019-12-12 17:22:46
【问题描述】:

我想在本地安装一个 NodeJs 区块链项目。在节点中安装依赖项时,我不断收到这些错误

gyp ERR! build error 
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1        
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Projects\blockchain\blockchain-verification-new\node_modules\contextify
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

我尝试了很多东西,比如更新 Visual Studio,它都是组件,但没有成功。有人可以帮忙吗?

【问题讨论】:

    标签: node.js visual-studio npm blockchain


    【解决方案1】:

    运行以下命令npm i -g windows-build-tools,它将安装python和其他所需的组件

    同时尝试更新您的 npm 配置(更改您的版本的路径):

    1. npm config set python python2.7 --global
    2. npm config set python C:\Python27\python.exe --global
    3. npm 配置设置 msvs_version 2015 --global
    4. npm config set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140

    【讨论】:

    • 你认为这是导致错误 e:\projects\blockchain\node_modules\contextify\src\contextify.cc(131): error C2661: 'v8::Function::NewInstance': no过度加载的函数需要 0 个参数 [E:\Projects\blockchain\blockchain-verification-new\node_modules\contextify\build\contextify.vcxproj]
    • 你使用的是最新的 NodeJs 版本吗?
    猜你喜欢
    • 1970-01-01
    • 2016-03-06
    • 1970-01-01
    • 2018-05-25
    • 2019-06-17
    • 1970-01-01
    • 2018-09-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多