vs code里编译出错Load serialport failed.

发布于 2020-11-18 21:24
1148浏览
0收藏

burn后出现

> Executing task: hpm run 'upload' <
Start flash images...
Load serialport failed.
Please make sure system variable 'NODE_PATH' has been configured.
You can run "npm config get prefix" to get prefix path, Set NODE_PATH to prefix\node_modules
Do you want to install modules: serialport now? y/n (default:y):

我已经设置过系统变量了且确认无误//环境系统变量配置:NODE_PATH  C:\Users\Administrator\AppData\Roaming\npm\node_modules

输入y回车后。弹出:

> Executing task: npm install -g serialport <
(node:4460) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
> @serialport/bindings@9.0.2 install C:\Users\Administrator\AppData\Roaming\npm\node_modules\serialport\node_modules\@serialport\bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
(node:10052) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
prebuild-install WARN install Request timed out
C:\Users\Administrator\AppData\Roaming\npm\node_modules\serialport\node_modules\@serialport\bindings>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node 
"C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
  serialport.cpp
  serialport_win.cpp
  win_delay_load_hook.cc
C:\\Users\\Administrator\\AppData\\Local\\node-gyp\\Cache\\14.15.0\\x64\\node.lib : fatal error LNK1106: 文件无效或磁盘已满: 无法查找到 0x376F20 [C:\Users\Admi
nistrator\AppData\Roaming\npm\node_modules\serialport\node_modules\@serialport\bindings\build\bindings.vcxproj]
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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19041
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 C:\Users\Administrator\AppData\Roaming\npm\node_modules\serialport\node_modules\@serialport\bindings
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@9.0.2 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@9.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-11-18T13_16_30_762Z-debug.log
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm install -g serialport" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
> Executing task: hpm run 'upload' <
Start flash images...
Load serialport failed.
Please make sure system variable 'NODE_PATH' has been configured.
You can run "npm config get prefix" to get prefix path, Set NODE_PATH to prefix\node_modules
Do you want to install modules: serialport now? y/n (default:y):

试了n多次,一直解决不了,请问您应该怎么办?

 

已于2020-11-18 21:24:01修改
收藏 0
回复
举报
回复
上传资料包
上传文件可以提高自己的声望,一次最多可上传3个文件 查看上传规则
    这个用户很懒,还没有个人简介
    帖子
    视频
    声望
    粉丝