【发布时间】:2021-06-17 16:42:33
【问题描述】:
我正在尝试安装 VueJS,但出现错误。
我在 Windows 上的 Ubuntu 上使用 Bash
节点-v
v15.12.0
npm -v
7.6.3
我试过了
npm install -g @vue/cli
但这会给我一些警告和错误
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v15.12.0/lib/node_modules/@vue/cli/node_modules/core-js
npm ERR! command failed
npm ERR! command sh -c node -e "try{require('./postinstall')}catch(e){}"
npm ERR! sh: 1: node: Permission denied
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-03-20T13_34_56_981Z-debug.log
我用 sudo 尝试过,但我已经以管理员身份运行它。
sudo: npm: command not found
在那之后我尝试了npm install -g --unsafe-perm @vue/cli,但我得到了和以前一样的错误信息。
后来我尝试了
npm config set user 0
npm config set unsafe-perm true
在我尝试之后,我又做了一次npm install -g @vue/cli,但这也返回了同样的错误。
然后我尝试了这个
npm install vue
npm cache clean --force
npm install -g @vue/cli
但这对我也不起作用,它返回了同样的错误......
那么有人可以帮助解决这个错误吗?
【问题讨论】: