Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ENOENT error - Installing aws-cdk node module

After running command:

       sudo npm i -g aws-cdk

gives error:

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

Am installing aws-cdk module to create private CA & certificates using AWS ACM service

{ 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' }

How to resolve this error? Am able to install other npm modules(like typescript)

like image 772
overexchange Avatar asked Jun 24 '19 20:06

overexchange


People also ask

How do I install AWS CDK on Windows 10?

To install AWS CDK, run the following command in your terminal: npm install -g aws-cdk . This will install the AWS CDK package globally on your system which then allows you to initialize your first project and start building and deploying code in your AWS account using AWS CDK.

How do I uninstall AWS CDK?

In order to delete a CDK stack, we have to use the cdk destroy command. Copied! If we have more than 1 stack in our CDK app, we have to explicitly specify the name of the stack we want to delete.


1 Answers

I had this issue just today. I think it is because the Ubuntu apt install of nodejs wasn't working. I uninstalled it sudo apt remove nodejs, then manually installed files from https://nodejs.org/en/download/ which was basically just sudo cp -r all the sub directories from the download into /usr/local/. It worked after that.

like image 189
loosethinker Avatar answered Oct 01 '22 14:10

loosethinker