无法在 Ubuntu 20.4 服务器上运行 npm 安装



我有一个node.js应用程序,我想在Ubuntu 20.4服务器上运行,当我尝试运行命令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

相关内容

  • 没有找到相关文章

最新更新