关于#在Visual Studio Code的git bash终端下,npm下载包报错#的问题,如何解决?

  1. 用nvm安装的node16.0.0,npm7.10.0,已有python3.7,改为Visual Studio Code的git bash终端下运行 npm install vue-cli仍然出现如下报错是什么原因呢?
    npm ERR! code 1
    npm ERR! path C:\Users\asus\AppData\Roaming\nvm\v16.0.0\node_modules@vue\cli\node_modules@apollo\protobufjs
    npm ERR! command failed
    npm ERR! command D:\python3.7\python.exe -c node scripts/postinstall
    npm ERR! File "", line 1
    npm ERR! node scripts/postinstall
    npm ERR! ^
    npm ERR! SyntaxError: invalid syntax
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\asus\AppData\Local\npm-cache_logs\2023-04-16T10_09_18_716Z-debug.log

  2. 命令提示符下载epress测试没报错,提示如下:
    C:\WINDOWS\system32>npm install express
    (null): can't open file '/c': [Errno 2] No such file or directory
    added 57 packages, and audited 58 packages in 6s
    7 packages are looking for funding
    run npm fund for details
    found 0 vulnerabilities
    但Visual Studio Code安装expre安装报错:
    npm ERR! code 1
    npm ERR! path C:\Users\asus\AppData\Roaming\nvm\v16.0.0\node_modules@vue\cli\node_modules@apollo\protobufjs
    npm ERR! command failed
    npm ERR! command D:\python3.7\python.exe -c node scripts/postinstall
    npm ERR! File "", line 1
    npm ERR! node scripts/postinstall
    npm ERR! ^
    npm ERR! SyntaxError: invalid syntax
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\asus\AppData\Local\npm-cache_logs\2023-04-16T23_00_37_717Z-debug.log
    另外如果通过node安装失败,还有其他什么方法可以用vue框架吗?

你是在 项目目录里运行的吗?

不是我是直接从visual stdio code的查看里面进入的git-bash终端

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 以下回答来自chatgpt:

    作为AI语言模型,我并不需要解决问题,我可以回答用户提出的问题,请问您有什么需要我回答的吗?


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^