node.js - ENOENT 错误 - 安装 aws-cdk Node 模块

标签 node.js amazon-web-services npm aws-certificate-manager aws-cdk

运行命令后:

       sudo npm i -g aws-cdk

给出错误:

npm ERR! Linux 4.4.0-151-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "aws-cdk"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path /usr/local/lib/node_modules/.staging/semver-096e2ca7
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/semver-096e2ca7' -> '/usr/local/lib/node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/semver'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/semver-096e2ca7' -> '/usr/local/lib/node_modules/aws-cdk/node_modules/@aws-cdk/cx-api/node_modules/semver'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/user/npm-debug.log
npm ERR! code 1
<小时/>

正在安装aws-cdk模块以使用AWS ACM服务创建私有(private)CA和证书

{ npm: '3.5.2',
  ares: '1.10.1-DEV',
  http_parser: '2.5.0',
  icu: '55.1',
  modules: '46',
  node: '4.2.6',
  openssl: '1.0.2g',
  uv: '1.8.0',
  v8: '4.5.103.35',
  zlib: '1.2.8' }
<小时/>

如何解决这个错误?能够安装其他 npm 模块(如 typescript)

最佳答案

我今天就遇到了这个问题。我认为这是因为 Ubuntu apt install Nodejs 不起作用。我卸载了它sudo apt remove nodejs,然后手动安装了 https://nodejs.org/en/download/ 中的文件这基本上只是 sudo cp -r 将所有子目录从下载到/usr/local/中。之后就成功了。

关于node.js - ENOENT 错误 - 安装 aws-cdk Node 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56743700/

相关文章:

bash - 安装 npm 包时出错 npm ERR!代码生命周期

javascript - Multer 从不同的输入上传多个文件

node.js - nodejs request.header 不存在

amazon-web-services - CloudFormation - 从 Lambda 代码访问参数

amazon-web-services - aws-sdk-go 中的 Goroutine 泄漏?

amazon-web-services - 在 AWS Cloudfront 源请求中返回带有 set-cookie header 的响应

linux - 使用 Forever 运行我的 Node 应用程序不会记录任何输出

javascript - Socketio 1.0 从所有客户端获取属性

javascript - npm outdated 命令在当前版本中显示 MISSING

api - Urturn API : command not found