gpt4 book ai didi

node.js - 无法在 Ubuntu 20.4 服务器上运行 npm install

转载 作者:行者123 更新时间:2023-12-04 19:05:42 25 4
gpt4 key购买 nike

我有一个想要在 Ubuntu 20.4 服务器上运行的 node.js 应用程序,当我尝试运行命令 npm install 时,我看到以下错误,我在服务器上没有 root 访问权限,这个问题可能出在哪里?我有 6.14.3 版本的 npm 和 14.15.3 版本,我该如何处理这个问题?

```
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

> core-js@2.6.12 postinstall /var/www/site/public_html/node_modules/@nuxt/babel-preset-app/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js@3.10.2 postinstall /var/www/site/public_html/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> bootstrap-vue@2.21.2 postinstall /var/www/site/public_html/node_modules/bootstrap-vue
> opencollective || exit 0

sh: 1: opencollective: Permission denied

> nuxt@2.15.4 postinstall /var/www/site/public_html/node_modules/nuxt
> opencollective || exit 0

sh: 1: opencollective: Permission denied

> swiper@5.4.5 postinstall /var/www/site/public_html/node_modules/swiper
> echo "Love Swiper? Support Vladimir's work by donating or pledging on patreon:
> https://patreon.com/vladimirkharlampidi
"

Love Swiper? Support Vladimir's work by donating or pledging on patreon:
> https://patreon.com/vladimirkharlampidi

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1334 packages from 697 contributors and audited 1338 packages in 17.59s

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

found 58 vulnerabilities (39 moderate, 18 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
```

最佳答案

这可能有权限问题
尝试这个

sudo npm cache clean 
sudo npm install

关于node.js - 无法在 Ubuntu 20.4 服务器上运行 npm install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70365405/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com