npm 无法使用atlassian/default-image安装无服务器

4urapxun  于 2022-12-27  发布在  其他
关注(0)|答案(1)|浏览(107)

我有一个无服务器应用程序,我尝试使用Bitbucket管道创建一个构建,
我使用atlassian/default-image:3图像作为管道图像,
它预装了node和一些其他有用的库。
预安装的节点和npm版本如下-
节点- v14.17.5
国家预防机制-6.14.14
尝试使用命令安装无服务器时-
npm install -g serverless
我收到以下错误-

npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated superagent@7.1.6: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731)
/root/.nvm/versions/node/v14.17.5/bin/serverless -> /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless/bin/serverless.js
/root/.nvm/versions/node/v14.17.5/bin/sls -> /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless/bin/serverless.js

> es5-ext@0.10.62 postinstall /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless/node_modules/es5-ext
>  node -e "try{require('./_postinstall')}catch(e){}" || exit 0

sh: 1: node: Permission denied

> serverless@3.25.1 postinstall /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless
> node ./scripts/postinstall.js

sh: 1: node: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/serverless/node_modules/chokidar/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"})

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! serverless@3.25.1 postinstall: `node ./scripts/postinstall.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the serverless@3.25.1 postinstall 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!     /root/.npm/_logs/2022-12-14T06_11_03_877Z-debug.log
yeotifhr

yeotifhr1#

检查正在使用的节点版本(节点--版本)。我使用nvm,目前切换到一个旧版本的节点,并得到了同样的错误。安装和切换到节点v19.3.0(最新的时间张贴)的nom安装无服务器工作。

相关问题